Skip to content

Commit 6ba0165

Browse files
authored
Feat/mcp example (#284)
# Pull Request Description This PR adds an example for the MCP server
2 parents 13dc676 + 218392c commit 6ba0165

File tree

9 files changed

+10340
-8
lines changed

9 files changed

+10340
-8
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.env
2+
node_modules
3+
build
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<div align="center">
2+
3+
# Solana Agent Kit MCP Server
4+
## SendAI
5+
6+
</div>
7+
8+
A Solana Agent Kit implementation using the Model Context Protocol (MCP) for handling protocol operations on the Solana blockchain.
9+
10+
## Features
11+
12+
- Supports all actions from the Solana Agent Kit
13+
- MCP server implementation for standardized interactions
14+
- Environment-based configuration
15+
16+
## Prerequisites
17+
18+
- Node.js (v16 or higher recommended)
19+
- pnpm or yarn or npm
20+
- Solana wallet with private key
21+
- Solana RPC URL
22+
23+
## Installation
24+
25+
```bash
26+
pnpm install
27+
```
28+
29+
## Configuration
30+
31+
1. Configure the `claude_desktop_config.json` file by editing the `env` fields.
32+
33+
```env
34+
SOLANA_PRIVATE_KEY=your_private_key_here
35+
RPC_URL=your_solana_rpc_url_here
36+
```
37+
38+
2. Change the Claude Desktop MCP server settings:
39+
40+
For MacOS:
41+
```bash
42+
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
43+
```
44+
45+
For Windows:
46+
```bash
47+
code $env:AppData\Claude\claude_desktop_config.json
48+
```
49+
50+
The final configuration should look like the following (replace the path with your absolute project path):
51+
52+
```json
53+
{
54+
"mcpServers": {
55+
"agent-kit": {
56+
"command": "node",
57+
"env": {
58+
"RPC_URL": "your_solana_rpc_url_here",
59+
"SOLANA_PRIVATE_KEY": "your_private_key_here"
60+
},
61+
"args": [
62+
"/ABSOLUTE/PATH/TO/YOUR/PROJECT"
63+
]
64+
}
65+
}
66+
}
67+
```
68+
69+
Note: Make sure to restart Claude Desktop after updating the configuration and building the project.
70+
71+
## Building the Project
72+
73+
To build the project, run:
74+
75+
```bash
76+
pnpm run build
77+
```
78+
79+
This will compile the TypeScript code and set the appropriate permissions for the executable.
80+
81+
## Project Structure
82+
83+
- `src/` - Source code directory
84+
- `src/index.ts` - Main entry point implementing the MCP server
85+
86+
## Dependencies
87+
88+
- [solana-agent-kit](https://github.com/sendaifun/solana-agent-kit): Core functionality for Solana blockchain interactions
89+
- [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk): MCP implementation
90+
- dotenv: Environment variable management
91+
- zod: Runtime type checking
92+
93+
## License
94+
95+
ISC
96+
97+
## Contributing
98+
99+
Contributions are welcome! Please feel free to submit a Pull Request.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"mcpServers": {
3+
"agent-kit": {
4+
"command": "node",
5+
"env" : {
6+
"OPENAI_API_KEY": "optional_openai_api_key_here",
7+
"RPC_URL": "your_rpc_url_here",
8+
"SOLANA_PRIVATE_KEY": "your_private_key_here"
9+
},
10+
"args": [
11+
"/absolute/path/to/build/index.js"
12+
]
13+
}
14+
}
15+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "agent-kit",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"type": "module",
7+
"bin": {
8+
"weather": "./build/index.js"
9+
},
10+
"scripts": {
11+
"build": "tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\""
12+
},
13+
"files": [
14+
"build"
15+
],
16+
"keywords": [],
17+
"author": "",
18+
"license": "ISC",
19+
"dependencies": {
20+
"@modelcontextprotocol/sdk": "^1.5.0",
21+
"dotenv": "^16.4.7",
22+
"solana-agent-kit": "1.4.8",
23+
"zod": "^3.24.2"
24+
},
25+
"devDependencies": {
26+
"@types/node": "^22.13.4",
27+
"typescript": "^5.7.3"
28+
}
29+
}

0 commit comments

Comments
 (0)