@venumdev/mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Venum
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,157 @@
1
+ # Venum MCP
2
+
3
+ Composable Solana execution infrastructure, for coding agents.
4
+
5
+ `@venumdev/mcp` is the MCP server for the Venum Solana execution stack. It gives coding agents and trading agents a stable tool surface for prices, pools, quotes, swap building, local signing + submission, and transaction tracking. It is designed to work with `Venum Skills` for higher-level workflows and agent context.
6
+
7
+ - Website: [www.venum.dev](https://www.venum.dev)
8
+ - CLI: [github.com/venumhq/solana-venum-cli](https://github.com/venumhq/solana-venum-cli)
9
+ - Skills: [github.com/venumhq/solana-venum-skills](https://github.com/venumhq/solana-venum-skills)
10
+ - Terminal: [github.com/venumhq/solana-venum-terminal](https://github.com/venumhq/solana-venum-terminal)
11
+
12
+ Venum's core product direction stays the same:
13
+
14
+ > Less raw RPC. More executable actions.
15
+
16
+ This repo is the MCP-native part of that OSS surface.
17
+
18
+ ## What It Does
19
+
20
+ - Exposes Venum execution primitives as MCP tools
21
+ - Wraps the Venum CLI in JSON mode for stable machine-readable tool results
22
+ - Keeps the initial tool surface narrow and composable
23
+ - Fits coding-agent and trading-agent workflows better than raw RPC glue
24
+
25
+ ## Tool Surface
26
+
27
+ - `health`
28
+ - `price`
29
+ - `prices`
30
+ - `pools`
31
+ - `tokens`
32
+ - `quote`
33
+ - `swap_build`
34
+ - `swap_sign_and_submit`
35
+ - `tx_status`
36
+
37
+ ## Install
38
+
39
+ Run without installing:
40
+
41
+ ```bash
42
+ pnpm dlx @venumdev/mcp
43
+ ```
44
+
45
+ Install globally:
46
+
47
+ ```bash
48
+ pnpm add -g @venumdev/mcp
49
+ venum-mcp
50
+ ```
51
+
52
+ Install locally:
53
+
54
+ ```bash
55
+ pnpm add @venumdev/mcp
56
+ ```
57
+
58
+ ## API Key
59
+
60
+ Most Venum tools require an API key.
61
+
62
+ Get one at [www.venum.dev](https://www.venum.dev), then configure the underlying CLI once:
63
+
64
+ ```bash
65
+ venum config set api-key <your-key>
66
+ ```
67
+
68
+ If you already saved your key with `venum config set api-key`, `@venumdev/mcp` will reuse that config automatically through the Venum CLI. In that case, you usually do not need to pass `VENUM_API_KEY` again in the MCP client config.
69
+
70
+ Or pass environment variables to the MCP process:
71
+
72
+ ```bash
73
+ VENUM_API_KEY=<your-key>
74
+ VENUM_API_URL=https://api.venum.dev
75
+ ```
76
+
77
+ ## How It Works
78
+
79
+ The current implementation is intentionally thin:
80
+
81
+ - MCP receives a tool call
82
+ - the server invokes `@venumdev/cli`
83
+ - the CLI runs in `--json` mode
84
+ - the MCP server returns the parsed JSON result to the agent
85
+
86
+ This keeps the tool contract stable while the broader Venum SDK and MCP surface evolves.
87
+
88
+ ## Example MCP Config
89
+
90
+ If your machine already has a saved Venum CLI config, this is enough:
91
+
92
+ ```json
93
+ {
94
+ "mcpServers": {
95
+ "venum": {
96
+ "command": "pnpm",
97
+ "args": ["dlx", "@venumdev/mcp"]
98
+ }
99
+ }
100
+ }
101
+ ```
102
+
103
+ If you want to pass the API key directly to the MCP process:
104
+
105
+ ```json
106
+ {
107
+ "mcpServers": {
108
+ "venum": {
109
+ "command": "pnpm",
110
+ "args": ["dlx", "@venumdev/mcp"],
111
+ "env": {
112
+ "VENUM_API_KEY": "<your-key>"
113
+ }
114
+ }
115
+ }
116
+ }
117
+ ```
118
+
119
+ This works well for Claude, OpenCode, and other stdio-based MCP clients.
120
+
121
+ You can also use a global install instead of `pnpm dlx`:
122
+
123
+ ```json
124
+ {
125
+ "mcpServers": {
126
+ "venum": {
127
+ "command": "venum-mcp"
128
+ }
129
+ }
130
+ }
131
+ ```
132
+
133
+ ## Development
134
+
135
+ ```bash
136
+ pnpm install
137
+ pnpm start
138
+ pnpm check
139
+ pnpm publint
140
+ ```
141
+
142
+ ## Why This Exists
143
+
144
+ The Venum plan is to build the composable Solana execution layer for coding agents and trading agents.
145
+
146
+ That means:
147
+
148
+ - CLI-first workflows
149
+ - JSON-native outputs
150
+ - stable tool semantics
151
+ - fewer moving parts than raw RPC plus custom infra glue
152
+
153
+ `@venumdev/mcp` is the direct expression of that strategy.
154
+
155
+ ## License
156
+
157
+ MIT
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,303 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from 'node:child_process';
3
+ import { dirname, join } from 'node:path';
4
+ import { createRequire } from 'node:module';
5
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
6
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
7
+ import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
8
+ const require = createRequire(import.meta.url);
9
+ const cliPackagePath = require.resolve('@venumdev/cli/package.json');
10
+ const cliEntry = join(dirname(cliPackagePath), 'dist', 'index.js');
11
+ const tools = [
12
+ {
13
+ name: 'health',
14
+ description: 'Check Venum API health.',
15
+ inputSchema: { type: 'object', properties: {}, additionalProperties: false },
16
+ buildArgs: () => ['health'],
17
+ },
18
+ {
19
+ name: 'price',
20
+ description: 'Get one token price by symbol or mint.',
21
+ inputSchema: {
22
+ type: 'object',
23
+ properties: {
24
+ token: { type: 'string', description: 'Token symbol or mint.' },
25
+ },
26
+ required: ['token'],
27
+ additionalProperties: false,
28
+ },
29
+ buildArgs: (args) => ['price', requiredString(args, 'token')],
30
+ },
31
+ {
32
+ name: 'prices',
33
+ description: 'Get prices for one or more tokens.',
34
+ inputSchema: {
35
+ type: 'object',
36
+ properties: {
37
+ tokens: {
38
+ oneOf: [
39
+ { type: 'string', description: 'Comma-separated tokens.' },
40
+ { type: 'array', items: { type: 'string' }, description: 'Array of token symbols or mints.' },
41
+ ],
42
+ },
43
+ },
44
+ additionalProperties: false,
45
+ },
46
+ buildArgs: (args) => {
47
+ const tokens = optionalTokenList(args.tokens);
48
+ return tokens ? ['prices', tokens] : ['prices'];
49
+ },
50
+ },
51
+ {
52
+ name: 'pools',
53
+ description: 'List pools filtered by token, pair, or DEX.',
54
+ inputSchema: {
55
+ type: 'object',
56
+ properties: {
57
+ token: { type: 'string' },
58
+ tokens: { oneOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }] },
59
+ tokenA: { type: 'string' },
60
+ tokenB: { type: 'string' },
61
+ dex: { type: 'string' },
62
+ limit: { type: 'number' },
63
+ offset: { type: 'number' },
64
+ },
65
+ additionalProperties: false,
66
+ },
67
+ buildArgs: (args) => {
68
+ const result = ['pools'];
69
+ if (typeof args.token === 'string')
70
+ result.push('--token', args.token);
71
+ const tokens = optionalTokenList(args.tokens);
72
+ if (tokens)
73
+ result.push('--tokens', tokens);
74
+ if (typeof args.tokenA === 'string' && typeof args.tokenB === 'string')
75
+ result.push(args.tokenA, args.tokenB);
76
+ if (typeof args.dex === 'string')
77
+ result.push('--dex', args.dex);
78
+ if (typeof args.limit === 'number')
79
+ result.push('--limit', String(args.limit));
80
+ if (typeof args.offset === 'number')
81
+ result.push('--offset', String(args.offset));
82
+ return result;
83
+ },
84
+ },
85
+ {
86
+ name: 'tokens',
87
+ description: 'List supported tokens, optionally filtered by category.',
88
+ inputSchema: {
89
+ type: 'object',
90
+ properties: {
91
+ category: { type: 'string' },
92
+ },
93
+ additionalProperties: false,
94
+ },
95
+ buildArgs: (args) => {
96
+ const result = ['tokens'];
97
+ if (typeof args.category === 'string')
98
+ result.push('--category', args.category);
99
+ return result;
100
+ },
101
+ },
102
+ {
103
+ name: 'quote',
104
+ description: 'Quote a swap route between two tokens.',
105
+ inputSchema: {
106
+ type: 'object',
107
+ properties: {
108
+ inputMint: { type: 'string' },
109
+ outputMint: { type: 'string' },
110
+ amount: { type: 'string' },
111
+ slippageBps: { type: 'number' },
112
+ },
113
+ required: ['inputMint', 'outputMint', 'amount'],
114
+ additionalProperties: false,
115
+ },
116
+ buildArgs: (args) => {
117
+ const result = ['quote', requiredString(args, 'inputMint'), requiredString(args, 'outputMint'), requiredString(args, 'amount')];
118
+ if (typeof args.slippageBps === 'number')
119
+ result.push('--slippage', String(args.slippageBps));
120
+ return result;
121
+ },
122
+ },
123
+ {
124
+ name: 'swap_build',
125
+ description: 'Build an unsigned swap transaction.',
126
+ inputSchema: {
127
+ type: 'object',
128
+ properties: {
129
+ inputMint: { type: 'string' },
130
+ outputMint: { type: 'string' },
131
+ amount: { type: 'string' },
132
+ wallet: { type: 'string', description: 'Wallet public key.' },
133
+ slippageBps: { type: 'number' },
134
+ },
135
+ required: ['inputMint', 'outputMint', 'amount', 'wallet'],
136
+ additionalProperties: false,
137
+ },
138
+ buildArgs: (args) => {
139
+ const result = [
140
+ 'swap',
141
+ 'build',
142
+ requiredString(args, 'inputMint'),
143
+ requiredString(args, 'outputMint'),
144
+ requiredString(args, 'amount'),
145
+ '--wallet',
146
+ requiredString(args, 'wallet'),
147
+ ];
148
+ if (typeof args.slippageBps === 'number')
149
+ result.push('--slippage', String(args.slippageBps));
150
+ return result;
151
+ },
152
+ },
153
+ {
154
+ name: 'swap_sign_and_submit',
155
+ description: 'Sign a Venum swap locally and submit it.',
156
+ inputSchema: {
157
+ type: 'object',
158
+ properties: {
159
+ inputMint: { type: 'string' },
160
+ outputMint: { type: 'string' },
161
+ amount: { type: 'string' },
162
+ keypair: { type: 'string', description: 'Path to local Solana keypair JSON.' },
163
+ slippageBps: { type: 'number' },
164
+ wait: { type: 'boolean' },
165
+ buildFile: { type: 'string' },
166
+ quoteId: { type: 'string' },
167
+ tx: { type: 'string' },
168
+ file: { type: 'string' },
169
+ },
170
+ required: ['keypair'],
171
+ additionalProperties: false,
172
+ },
173
+ buildArgs: (args) => {
174
+ const result = ['swap', 'sign-and-submit'];
175
+ if (typeof args.buildFile === 'string') {
176
+ result.push('--build-file', args.buildFile);
177
+ }
178
+ else if (typeof args.quoteId === 'string') {
179
+ result.push('--quote-id', args.quoteId);
180
+ if (typeof args.tx === 'string')
181
+ result.push('--tx', args.tx);
182
+ if (typeof args.file === 'string')
183
+ result.push('--file', args.file);
184
+ }
185
+ else {
186
+ result.push(requiredString(args, 'inputMint'), requiredString(args, 'outputMint'), requiredString(args, 'amount'));
187
+ }
188
+ result.push('--keypair', requiredString(args, 'keypair'));
189
+ if (typeof args.slippageBps === 'number')
190
+ result.push('--slippage', String(args.slippageBps));
191
+ if (args.wait === true)
192
+ result.push('--wait');
193
+ return result;
194
+ },
195
+ },
196
+ {
197
+ name: 'tx_status',
198
+ description: 'Check transaction status by signature.',
199
+ inputSchema: {
200
+ type: 'object',
201
+ properties: {
202
+ signature: { type: 'string' },
203
+ },
204
+ required: ['signature'],
205
+ additionalProperties: false,
206
+ },
207
+ buildArgs: (args) => ['tx', requiredString(args, 'signature')],
208
+ },
209
+ ];
210
+ const server = new Server({
211
+ name: '@venumdev/mcp',
212
+ version: '0.1.0',
213
+ }, {
214
+ capabilities: {
215
+ tools: {},
216
+ },
217
+ });
218
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
219
+ tools: tools.map((tool) => ({
220
+ name: tool.name,
221
+ description: tool.description,
222
+ inputSchema: tool.inputSchema,
223
+ })),
224
+ }));
225
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
226
+ const tool = tools.find((candidate) => candidate.name === request.params.name);
227
+ if (!tool) {
228
+ return toolError(`Unknown tool: ${request.params.name}`);
229
+ }
230
+ try {
231
+ const args = tool.buildArgs((request.params.arguments ?? {}));
232
+ const result = await runVenumJson(args);
233
+ return {
234
+ content: [
235
+ {
236
+ type: 'text',
237
+ text: JSON.stringify(result, null, 2),
238
+ },
239
+ ],
240
+ };
241
+ }
242
+ catch (error) {
243
+ return toolError(error instanceof Error ? error.message : String(error));
244
+ }
245
+ });
246
+ const transport = new StdioServerTransport();
247
+ await server.connect(transport);
248
+ async function runVenumJson(args) {
249
+ const output = await runCommand([...args, '--json']);
250
+ return JSON.parse(output);
251
+ }
252
+ function runCommand(args) {
253
+ return new Promise((resolve, reject) => {
254
+ const child = spawn(process.execPath, [cliEntry, ...args], {
255
+ env: process.env,
256
+ stdio: ['ignore', 'pipe', 'pipe'],
257
+ });
258
+ let stdout = '';
259
+ let stderr = '';
260
+ child.stdout.on('data', (chunk) => {
261
+ stdout += chunk.toString();
262
+ });
263
+ child.stderr.on('data', (chunk) => {
264
+ stderr += chunk.toString();
265
+ });
266
+ child.on('error', reject);
267
+ child.on('close', (code) => {
268
+ if (code === 0) {
269
+ resolve(stdout.trim());
270
+ return;
271
+ }
272
+ reject(new Error(stderr.trim() || stdout.trim() || `venum exited with code ${code ?? 'unknown'}`));
273
+ });
274
+ });
275
+ }
276
+ function requiredString(args, key) {
277
+ const value = args[key];
278
+ if (typeof value !== 'string' || value.trim() === '') {
279
+ throw new Error(`Missing required string argument: ${key}`);
280
+ }
281
+ return value;
282
+ }
283
+ function optionalTokenList(value) {
284
+ if (typeof value === 'string' && value.trim() !== '')
285
+ return value;
286
+ if (Array.isArray(value)) {
287
+ const tokens = value.filter((item) => typeof item === 'string' && item.trim() !== '');
288
+ if (tokens.length > 0)
289
+ return tokens.join(',');
290
+ }
291
+ return undefined;
292
+ }
293
+ function toolError(message) {
294
+ return {
295
+ isError: true,
296
+ content: [
297
+ {
298
+ type: 'text',
299
+ text: message,
300
+ },
301
+ ],
302
+ };
303
+ }
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@venumdev/mcp",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for Venum, the Solana execution layer for coding agents and trading agents. Designed to work with Venum Skills.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "venum-mcp": "dist/index.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ },
16
+ "./package.json": "./package.json"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "README.md"
21
+ ],
22
+ "scripts": {
23
+ "start": "tsx src/index.ts",
24
+ "dev": "tsx src/index.ts",
25
+ "build": "tsc -p tsconfig.json",
26
+ "check": "tsc -p tsconfig.json --noEmit",
27
+ "publint": "publint",
28
+ "prepack": "pnpm build",
29
+ "prepublishOnly": "pnpm build"
30
+ },
31
+ "engines": {
32
+ "node": ">=22.0.0"
33
+ },
34
+ "keywords": [
35
+ "venum",
36
+ "solana",
37
+ "mcp",
38
+ "skills",
39
+ "agent",
40
+ "cli",
41
+ "trading",
42
+ "defi"
43
+ ],
44
+ "author": "Venum <hello@venum.dev>",
45
+ "license": "MIT",
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/venumhq/solana-venum-mcp.git"
49
+ },
50
+ "homepage": "https://www.venum.dev",
51
+ "bugs": {
52
+ "url": "https://github.com/venumhq/solana-venum-mcp/issues"
53
+ },
54
+ "dependencies": {
55
+ "@modelcontextprotocol/sdk": "^1.12.1",
56
+ "@venumdev/cli": "^0.1.0"
57
+ },
58
+ "devDependencies": {
59
+ "@types/node": "^24.5.2",
60
+ "publint": "^0.3.18",
61
+ "tsx": "^4.20.5",
62
+ "typescript": "^5.9.2"
63
+ }
64
+ }