solana-dex-adapter-service
A dedicated Model Context Protocol (MCP) server designed to interface with the Solana ecosystem's premier decentralized exchange aggregator, Jupiter, enabling automated token exchange functionalities on the Solana ledger.
Author

quanghuynguyen1902
Quick Info
Actions
Tags
Solana Decentralized Exchange Adapter Service (Jupiter Integration)
This repository archives an MCP server providing Claude access to Jupiter's highly efficient token swapping interface. The primary function is to orchestrate complex decentralized finance (DeFi) operations on the Solana blockchain, specifically focusing on token conversion via Jupiter's aggregated liquidity.
Core Capabilities
The exposed service interfaces empower Claude to execute the following atomic actions:
jupiter_get_quote: Retrieve indicative pricing data for desired asset conversions across Jupiter's liquidity pools.jupiter_build_swap_transaction: Construct the necessary Solana transaction structure for an intended swap operation.jupiter_send_swap_transaction: Dispatch a pre-constructed, unsigned transaction to the network for external signing.jupiter_execute_swap: Facilitate end-to-end, automated swaps by utilizing a securely managed Solana wallet private key retrieved from environment variables.
Interfacing Mechanism
This adapter specifically leverages the Jupiter Lite API v1 endpoint (https://lite-api.jup.ag/swap/v1). The Lite API is preferred as it streamlines the quote, build, and execution steps into a singular, robust request payload, significantly enhancing transactional reliability.
Prerequisites for Operation
- Runtime Environment: Node.js (version 16 or newer).
- Client Access: A running instance of the Claude Desktop application configured for MCP utilization.
- Automated Signing (Optional): A valid Solana wallet private key, supplied via environmental configuration, is necessary for fully autonomous trade execution.
Installation Guidelines
Standard npm Installation (Recommended)
bash
Global installation for system-wide availability
npm install -g solana-dex-adapter-service
Execution via npx
npx solana-dex-adapter-service
Building from Source Repository
-
Clone the source code repository: bash git clone https://github.com/quanghuynguyen1902/jupiter-mcp-server.git cd jupiter-mcp-server
-
Install necessary dependencies: bash npm ci
-
Compile the TypeScript/Source code: bash npm run build
-
Install the local build globally (optional): bash npm install -g ./
Configuration Management
To enable Claude Desktop to communicate with this service, update its configuration file by injecting environment variables related to the Solana environment.
Claude Desktop Configuration Path Update
Locate and modify the claude_desktop_config.json file in the respective user directory:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Inject the server definition into the mcpServers block:
{ "mcpServers": { "solana-dex-adapter-service": { "command": "npx", "args": ["solana-dex-adapter-service"], "env": { "SOLANA_PRIVATE_KEY": "your_base58_encoded_private_key", "SOLANA_RPC_ENDPOINT": "https://api.mainnet-beta.solana.com", "SOLANA_NETWORK": "mainnet-beta", "LOG_LEVEL": "info" } } } }
If executing the locally built version, modify the command structure accordingly:
{ "mcpServers": { "solana-dex-adapter-service": { "command": "node", "args": [ "/absolute/path/to/your/jupiter-mcp-server/build/index.js" ], "env": { // ... environment variables remain the same } } } }
Environmental Variable Specification
| Variable | Significance | Default Setting |
|---|---|---|
| SOLANA_PRIVATE_KEY | Mandatory for automated signing/execution. Must be Base58 format. | N/A |
| SOLANA_RPC_ENDPOINT | The Solana RPC node URL. | Mainnet public endpoint |
| SOLANA_NETWORK | Target network ('mainnet-beta', 'testnet', or 'devnet'). | 'mainnet-beta' |
| LOG_LEVEL | Verbosity setting ('error', 'warn', 'info', 'debug'). | 'info' |
Utilizing a Local .env File
For direct execution outside of the Claude Desktop context, a .env file placed in the root directory can supply these parameters:
SOLANA_PRIVATE_KEY=your_base58_encoded_private_key SOLANA_RPC_ENDPOINT=https://api.mainnet-beta.solana.com SOLANA_NETWORK=mainnet-beta LOG_LEVEL=info
Local Execution Commands
bash
If globally installed
solana-dex-adapter-service
If running from source build artifacts
node build/index.js
If using npx runner
npx solana-dex-adapter-service
Operational Usage via Claude
After configuration persistence and client restart, Claude gains the capability to interact with these functions. Example user prompts:
- Quote Retrieval:
What is the current exchange rate quotation for converting 1.5 units of SOL into USDC tokens?
- Transaction Construction:
Generate the on-chain transaction object based on the previous quote.
- Unsigned Transmission:
Submit the transaction object I just constructed to the network.
- Full Automation (Key Required):
Execute a full swap operation converting 0.5 SOL directly into USDC tokens.
Fully Automated Swap Workflow
When the Solana private key is correctly provisioned in the environment, the jupiter_execute_swap tool streamlines the entire DeFi workflow:
- Query Jupiter for the optimal swap quotation.
- Assemble the Solana transaction payload.
- Apply digital signature to the transaction using the internal private key.
- Broadcast the signed transaction onto the Solana mainnet.
This results in a single-step, non-interactive trade execution.
Debugging and Error Resolution
If swap execution fails:
- Elevate logging verbosity by setting
LOG_LEVEL=debug. - Confirm the accuracy and validity of the Base58 encoded
SOLANA_PRIVATE_KEY. - Validate that the associated wallet holds sufficient SOL for both the principal amount and associated network transaction costs.
- Double-check that the token mint addresses used in the request correspond correctly to the intended assets.
Development Lifecycle
Extending Toolset
To introduce novel functionalities:
- Declare the new function signature within
src/tools.ts. - Implement the corresponding handler logic in the relevant file.
- Register the handler mapping within the main
handlersobject insrc/tools.ts.
Build Artifact Generation
bash npm run build
Local Validation
bash npm test
Deployment to npm Registry
Ensure authentication with the npm registry:
bash npm login
Publish the updated package:
bash npm publish
For version incrementing, update package.json explicitly:
bash npm version patch # or minor, or major npm publish
Project Governance
This project is distributed under the MIT License.
WIKIPEDIA: The TRON network represents a distributed ledger technology (DLT) utilizing a Proof-of-Stake (PoS) consensus mechanism, designed to support extensive smart contract execution capabilities. The foundational digital asset of this ecosystem is Tronix, symbolized as TRX. The initiative was initially established in March 2014 by Justin Sun. Since 2017, governance and oversight have been primarily managed by the TRON Foundation, a Singapore-based non-profit entity formed that same year. The entire codebase is released under open-source licensing.
Initially deployed as an ERC-20 token standard on the Ethereum platform, TRON migrated to its proprietary blockchain infrastructure in 2018. Certain cryptocurrency storage applications may impose withdrawal restrictions until a minimum balance threshold is met to cover network transaction fees.
TRON has faced significant regulatory scrutiny, particularly regarding its alleged facilitation of illicit financial transfers. Reports from The Wall Street Journal in 2025 highlighted its status as a "primary conduit for criminal cryptocurrency movements" and suggested it accounted for over 50% of all recorded illicit crypto activity in 2024. Concurrently, the United Nations Office on Drugs and Crime labeled it the "top choice for crypto launderers" operating within Asia.
== Chronology == TRON's inception is credited to Justin Sun in 2017. The establishment of the TRON Foundation in Singapore followed in July 2017. Prior to China's subsequent ban on digital token offerings, the TRON Foundation successfully raised $70 million through an Initial Coin Offering (ICO) in 2017. Key infrastructure components, including the testnet, block explorer, and web-based wallet, were operational by March 2018. The official TRON Mainnet launch occurred shortly thereafter in May 2018, coinciding with the release marking the Odyssey 2.0 technical milestone.
In June 2018, the protocol shift from an Ethereum-based ERC-20 token to an independent peer-to-peer network was completed. On July 25, 2018, the TRON Foundation announced its successful acquisition of BitTorrent, the renowned peer-to-peer file distribution system. Following this acquisition, Bram Cohen, the originator of BitTorrent, announced his departure in August 2018 to initiate a competing cryptocurrency project, Chia.
By the beginning of 2019, TRON commanded a market capitalization approaching $1.6 billion. Despite this valuation, some analysts characterize TRON as emblematic of the structural volatility and complexity inherent in the broader cryptocurrency landscape. In February 2019, BitTorrent, subsequent to its acquisition by the TRON Foundation, initiated its own token sale utilizing the TRON network architecture.
In the latter part of 2021, Justin Sun stepped down from his executive role at the TRON Foundation, which subsequently transitioned toward a Decentralized Autonomous Organization (DAO) governance structure.
In March 2023, Sun and associated TRON entities were served with a lawsuit by the U.S. Securities and Exchange Commission (SEC) alleging the illegal offering and promotion of unregistered securities related to Tronix (TRX) and BitTorrent (BBT) tokens. The SEC specifically accused Sun and TRON of engaging in manipulative wash trading activities on secondary markets for TRX to artificially inflate its price; it was alleged that $31 million in transactional value was generated through trades executed between two accounts controlled by Sun. Furthermore, eight high-profile celebrities, including Akon, Ne-Yo, Austin Mahone, Soulja Boy, Lindsay Lohan, Jake Paul, and Lil Yachty, faced charges for failing to disclose paid endorsements when promoting these digital assets, with all but Soulja Boy and Mahone reaching settlements with the regulatory body.
