@ginkosafe/mcp v0.1.0
Ginko MCP Server
A Model Context Protocol server for interacting with the Ginko Protocol on Solana.
This TypeScript-based MCP server provides tools to access and interact with Ginko Protocol functionality, allowing LLMs to query data and perform operations on the Solana blockchain.
Features
Tools
fetch_token_balance- Fetch token balance for a given owner and token mintplace_order- Place an order to buy or sell an assetcancel_order- Cancel an existing orderget_active_orders- Get all active orders for a userget_asset_balance- Fetch balance of an asset by symbol for a given ownerget_asset- Get asset information by symbol
Development
Installation
Install dependencies:
npm installBuild the server:
npm run buildFor development with auto-rebuild:
npm run watchConfiguration
Create a .env file based on the .env.example template:
cp .env.example .envConfigure the following environment variables:
SOLANA_RPC_URL: The Solana RPC URL to connect to (required)WALLET_PRIVATE_KEY: Private key for a Solana wallet (optional)SOLANA_RPC_COMMITMENT: Commitment level for Solana RPC (optional, defaults to "confirmed")
Installation with Claude
To use with Claude Desktop, add the server configuration to the Claude Desktop config file:
- On MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json - On Windows:
%APPDATA%/Claude/claude_desktop_config.json
Add the following configuration to the mcp_servers section of the config file:
{
"mcp_servers": {
"ginko-mcp": {
"command": "node",
"args": [
"/path/to/ginko-mcp/build/index.js"
],
"env": {
"SOLANA_RPC_URL": "https://solana-mainnet.api.syndica.io/api-key/your-api-key",
"WALLET_PRIVATE_KEY": "your-wallet-private-key"
}
}
}
}Replace:
/path/to/ginko-mcp/build/index.jswith the absolute path to the built index.js fileyour-api-keywith your Solana RPC API keyyour-wallet-private-keywith your Solana wallet private key
After adding the configuration, restart Claude Desktop to apply the changes.
Testing
You can test the server locally using the MCP Inspector tool, which is available as a package script:
npm run inspectorThe Inspector will provide a URL to access debugging tools in your browser where you can:
- Inspect available tools
- Test tool execution with custom parameters
- View logs and debug messages
Example usage of fetch_token_balance:
{
"owner": "FriELggez3BEbiJbj4Je7qkM2nZXfkmY9G7VrA8hgLSi",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"decimals": 6
}Debugging
Since MCP servers communicate over stdio, debugging can be challenging. Here are some tips:
- Use
console.error()for logging (notconsole.log()which interferes with stdio) - Run the server with the Inspector to see logs and requests
- Enable verbose logging by setting
DEBUG=1in your environment
9 months ago