@kraph/mcp-stdio 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/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # @kraph/mcp-stdio
2
+
3
+ **Stdio shim for Kraph's MCP gateway.** Bridges a local MCP stdio client (Claude Desktop, Cursor, custom integrations) to Kraph's hosted Streamable HTTP MCP endpoint at `https://api.kraph.com/mcp`. Use this when your host doesn't speak Streamable HTTP transport directly.
4
+
5
+ > Already on Claude Code or another HTTP-MCP-aware client? Skip this package — install Kraph directly:
6
+ > ```bash
7
+ > claude mcp add --transport http kraph https://api.kraph.com/mcp
8
+ > ```
9
+ > This shim only exists for hosts limited to stdio JSON-RPC.
10
+
11
+ ## Install
12
+
13
+ Zero-install via `npx`:
14
+
15
+ ```bash
16
+ npx -y @kraph/mcp-stdio
17
+ ```
18
+
19
+ Or pin it inside your MCP client's config (Claude Desktop, Cursor, etc.):
20
+
21
+ ```json
22
+ {
23
+ "mcpServers": {
24
+ "kraph": {
25
+ "command": "npx",
26
+ "args": ["-y", "@kraph/mcp-stdio"],
27
+ "env": {
28
+ "KRAPH_BEARER": "<your-bearer-token>"
29
+ }
30
+ }
31
+ }
32
+ }
33
+ ```
34
+
35
+ ## Authentication
36
+
37
+ The shim requires a pre-minted Bearer token in `KRAPH_BEARER`. To get one, follow the manual OAuth recipe at <https://kraph.com/llms.txt> (the "manual OAuth" section). Short version:
38
+
39
+ ```bash
40
+ # 1. PKCE pair
41
+ VERIFIER=$(openssl rand -base64 32 | tr -d "=+/" | cut -c1-43)
42
+ CHALLENGE=$(printf '%s' "$VERIFIER" | openssl dgst -sha256 -binary | openssl base64 | tr -d '=' | tr '/+' '_-')
43
+
44
+ # 2. Open this URL in a browser, complete Privy sign-in:
45
+ echo "https://api.kraph.com/authorize?response_type=code&code_challenge=$CHALLENGE&code_challenge_method=S256&redirect_uri=urn:ietf:wg:oauth:2.0:oob&client_id=manual&state=x"
46
+
47
+ # 3. Paste the code Kraph returns, then exchange for a Bearer:
48
+ read -p "code: " CODE
49
+ curl -s -X POST https://api.kraph.com/auth/privy/token -H "Content-Type: application/json" \
50
+ -d "{\"grant_type\":\"authorization_code\",\"code\":\"$CODE\",\"code_verifier\":\"$VERIFIER\",\"client_id\":\"manual\",\"redirect_uri\":\"urn:ietf:wg:oauth:2.0:oob\"}" \
51
+ | python3 -c "import json,sys;print(json.loads(sys.stdin.read())['access_token'])"
52
+ ```
53
+
54
+ Pin the printed `access_token` value into your MCP client's `env.KRAPH_BEARER`. Tokens last 7 days.
55
+
56
+ ## Endpoint selection
57
+
58
+ | Flag / env | Endpoint |
59
+ |---|---|
60
+ | (none — default) | `https://api.kraph.com/mcp` (devnet) |
61
+ | `mainnet` arg or `KRAPH_NETWORK=mainnet` | `https://api-mainnet.kraph.com/mcp` |
62
+ | `KRAPH_MCP_URL=<full-url>` | Custom gateway (operator deployments) |
63
+
64
+ Examples:
65
+
66
+ ```bash
67
+ # Devnet (default)
68
+ npx -y @kraph/mcp-stdio
69
+
70
+ # Mainnet
71
+ npx -y @kraph/mcp-stdio mainnet
72
+
73
+ # Custom
74
+ KRAPH_MCP_URL=https://your.gateway/mcp npx -y @kraph/mcp-stdio
75
+ ```
76
+
77
+ ## What this does (and doesn't)
78
+
79
+ - ✅ Forwards `tools/list`, `tools/call`, `resources/*`, `prompts/*` requests from stdio to the HTTP gateway.
80
+ - ✅ Carries `KRAPH_BEARER` on every upstream request — same x402 USDC payment semantics as direct HTTP.
81
+ - ❌ Does not run an interactive OAuth flow. v1 expects you to set `KRAPH_BEARER`. (Interactive OAuth is on the roadmap; for headless / sandboxed clients the env-var path is intentional.)
82
+ - ❌ Does not cache tool results or rewrite responses. Pure pass-through.
83
+
84
+ ## License
85
+
86
+ MIT
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @kraph/mcp-stdio — stdio→HTTP MCP shim for Kraph.
4
+ *
5
+ * Usage (inside an MCP client's config):
6
+ *
7
+ * "kraph": {
8
+ * "command": "npx",
9
+ * "args": ["-y", "@kraph/mcp-stdio"],
10
+ * "env": { "KRAPH_BEARER": "<your-bearer-token>" }
11
+ * }
12
+ *
13
+ * Run pre-built: kraph-mcp-stdio [devnet|mainnet]
14
+ *
15
+ * Why this exists: Kraph's real MCP endpoint is Streamable HTTP at
16
+ * api.kraph.com/mcp. Modern clients (Claude Code, the Anthropic MCP CLI)
17
+ * speak that natively — for them, use `claude mcp add --transport http
18
+ * kraph https://api.kraph.com/mcp` instead and skip this package. But
19
+ * some hosts (older Claude Desktop builds, custom integrations) only
20
+ * speak the stdio JSON-RPC subset of MCP. This shim sits in front of
21
+ * them: it accepts stdio MCP locally and forwards every request to the
22
+ * hosted HTTP endpoint, passing through the Bearer the user pinned via
23
+ * KRAPH_BEARER.
24
+ *
25
+ * Authentication: this v1 expects a pre-minted Bearer in KRAPH_BEARER.
26
+ * Get one via the manual OAuth recipe documented at
27
+ * https://kraph.com/llms.txt (the "If your Claude Code environment
28
+ * blocks /mcp" section). Future versions will add interactive OAuth
29
+ * triggered on first run; for now, sticking to the headless env-var
30
+ * path keeps the package small and tests easily inside sandboxed
31
+ * clients that can't pop browser windows.
32
+ *
33
+ * Endpoint selection: positional arg or KRAPH_NETWORK env var. Default
34
+ * is devnet (api.kraph.com/mcp) so paid-tool experimentation doesn't
35
+ * cost real USDC on first use.
36
+ *
37
+ * npx -y @kraph/mcp-stdio → devnet
38
+ * npx -y @kraph/mcp-stdio mainnet → mainnet (api-mainnet.kraph.com/mcp)
39
+ * KRAPH_NETWORK=mainnet npx ... → same as above
40
+ *
41
+ * Custom endpoint:
42
+ *
43
+ * npx -y @kraph/mcp-stdio https://your.gateway/mcp
44
+ * KRAPH_MCP_URL=https://your.gateway/mcp npx ...
45
+ */
46
+ export {};
47
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG"}
package/dist/index.js ADDED
@@ -0,0 +1,145 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @kraph/mcp-stdio — stdio→HTTP MCP shim for Kraph.
4
+ *
5
+ * Usage (inside an MCP client's config):
6
+ *
7
+ * "kraph": {
8
+ * "command": "npx",
9
+ * "args": ["-y", "@kraph/mcp-stdio"],
10
+ * "env": { "KRAPH_BEARER": "<your-bearer-token>" }
11
+ * }
12
+ *
13
+ * Run pre-built: kraph-mcp-stdio [devnet|mainnet]
14
+ *
15
+ * Why this exists: Kraph's real MCP endpoint is Streamable HTTP at
16
+ * api.kraph.com/mcp. Modern clients (Claude Code, the Anthropic MCP CLI)
17
+ * speak that natively — for them, use `claude mcp add --transport http
18
+ * kraph https://api.kraph.com/mcp` instead and skip this package. But
19
+ * some hosts (older Claude Desktop builds, custom integrations) only
20
+ * speak the stdio JSON-RPC subset of MCP. This shim sits in front of
21
+ * them: it accepts stdio MCP locally and forwards every request to the
22
+ * hosted HTTP endpoint, passing through the Bearer the user pinned via
23
+ * KRAPH_BEARER.
24
+ *
25
+ * Authentication: this v1 expects a pre-minted Bearer in KRAPH_BEARER.
26
+ * Get one via the manual OAuth recipe documented at
27
+ * https://kraph.com/llms.txt (the "If your Claude Code environment
28
+ * blocks /mcp" section). Future versions will add interactive OAuth
29
+ * triggered on first run; for now, sticking to the headless env-var
30
+ * path keeps the package small and tests easily inside sandboxed
31
+ * clients that can't pop browser windows.
32
+ *
33
+ * Endpoint selection: positional arg or KRAPH_NETWORK env var. Default
34
+ * is devnet (api.kraph.com/mcp) so paid-tool experimentation doesn't
35
+ * cost real USDC on first use.
36
+ *
37
+ * npx -y @kraph/mcp-stdio → devnet
38
+ * npx -y @kraph/mcp-stdio mainnet → mainnet (api-mainnet.kraph.com/mcp)
39
+ * KRAPH_NETWORK=mainnet npx ... → same as above
40
+ *
41
+ * Custom endpoint:
42
+ *
43
+ * npx -y @kraph/mcp-stdio https://your.gateway/mcp
44
+ * KRAPH_MCP_URL=https://your.gateway/mcp npx ...
45
+ */
46
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
47
+ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
48
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
49
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
50
+ import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
51
+ const DEVNET = "https://api.kraph.com/mcp";
52
+ const MAINNET = "https://api-mainnet.kraph.com/mcp";
53
+ function resolveEndpoint() {
54
+ // Precedence: KRAPH_MCP_URL (full custom URL) > positional arg > KRAPH_NETWORK env > default devnet.
55
+ const fromUrlEnv = (process.env.KRAPH_MCP_URL ?? "").trim();
56
+ if (fromUrlEnv) {
57
+ return { url: fromUrlEnv, label: fromUrlEnv };
58
+ }
59
+ const argv = process.argv.slice(2).filter((a) => !a.startsWith("-"));
60
+ const positional = argv[0]?.trim().toLowerCase();
61
+ const envNetwork = (process.env.KRAPH_NETWORK ?? "").trim().toLowerCase();
62
+ const choice = positional || envNetwork || "devnet";
63
+ if (choice === "mainnet")
64
+ return { url: MAINNET, label: "mainnet" };
65
+ if (choice === "devnet")
66
+ return { url: DEVNET, label: "devnet" };
67
+ // Anything else that looks like a URL — pass through.
68
+ if (/^https?:\/\//.test(choice)) {
69
+ return { url: choice, label: choice };
70
+ }
71
+ // Otherwise default to devnet with a warning to stderr.
72
+ process.stderr.write(`[kraph-mcp-stdio] unrecognised endpoint "${choice}", falling back to devnet\n`);
73
+ return { url: DEVNET, label: "devnet" };
74
+ }
75
+ function bearer() {
76
+ const t = (process.env.KRAPH_BEARER ?? process.env.KRAPH_MCP_BEARER ?? "").trim();
77
+ if (!t) {
78
+ process.stderr.write(`[kraph-mcp-stdio] KRAPH_BEARER is not set. Get a Bearer token via\n` +
79
+ ` https://kraph.com/llms.txt (the "manual OAuth" section)\n` +
80
+ `then set KRAPH_BEARER=<token> in your MCP client's env config.\n`);
81
+ process.exit(2);
82
+ }
83
+ return t;
84
+ }
85
+ async function main() {
86
+ const { url, label } = resolveEndpoint();
87
+ const token = bearer();
88
+ // Upstream client — speaks Streamable HTTP, carries the user's Bearer
89
+ // on every request. Initialise + connect FIRST so any auth error
90
+ // surfaces before the stdio side opens.
91
+ const upstreamUrl = new URL(url);
92
+ const upstream = new StreamableHTTPClientTransport(upstreamUrl, {
93
+ requestInit: {
94
+ headers: { Authorization: `Bearer ${token}` },
95
+ },
96
+ });
97
+ const client = new Client({ name: "kraph-mcp-stdio", version: "0.1.0" }, { capabilities: {} });
98
+ try {
99
+ await client.connect(upstream);
100
+ }
101
+ catch (err) {
102
+ const msg = err instanceof Error ? err.message : String(err);
103
+ process.stderr.write(`[kraph-mcp-stdio] failed to connect to ${label} (${url}): ${msg}\n`);
104
+ process.exit(1);
105
+ }
106
+ process.stderr.write(`[kraph-mcp-stdio] connected to ${label} (${url})\n`);
107
+ // Downstream stdio server. We register the MCP request methods we
108
+ // actually expect from a client (tools, resources, prompts) and just
109
+ // forward each request to the upstream client. Anything outside this
110
+ // set gets a generic method-not-found reply — same shape as a real
111
+ // server. Notifications (no response expected) flow one-way; the SDK
112
+ // handles those over the stdio transport without an explicit handler
113
+ // here.
114
+ const server = new Server({ name: "kraph-mcp-stdio-bridge", version: "0.1.0" }, {
115
+ capabilities: {
116
+ tools: {},
117
+ resources: {},
118
+ prompts: {},
119
+ },
120
+ });
121
+ // Use the SDK's high-level Client methods to forward each request
122
+ // type to the upstream. The Server.setRequestHandler signature is
123
+ // (schema, handler(req, extra)) → handler must return the result
124
+ // shape that matches schema's `.shape.result`. The Client's
125
+ // listTools/callTool/etc helpers already return that shape.
126
+ server.setRequestHandler(ListToolsRequestSchema, async (req) => client.listTools(req.params));
127
+ server.setRequestHandler(CallToolRequestSchema, async (req) => client.callTool(req.params));
128
+ server.setRequestHandler(ListResourcesRequestSchema, async (req) => client.listResources(req.params));
129
+ server.setRequestHandler(ReadResourceRequestSchema, async (req) => client.readResource(req.params));
130
+ server.setRequestHandler(ListPromptsRequestSchema, async (req) => client.listPrompts(req.params));
131
+ server.setRequestHandler(GetPromptRequestSchema, async (req) => client.getPrompt(req.params));
132
+ const transport = new StdioServerTransport();
133
+ await server.connect(transport);
134
+ // Keep the process alive — both transports are event-driven, so
135
+ // Node would otherwise exit when the initial main() returns.
136
+ process.stdin.on("end", () => {
137
+ void server.close().then(() => process.exit(0));
138
+ });
139
+ }
140
+ main().catch((err) => {
141
+ const msg = err instanceof Error ? err.message : String(err);
142
+ process.stderr.write(`[kraph-mcp-stdio] fatal: ${msg}\n`);
143
+ process.exit(1);
144
+ });
145
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,MAAM,MAAM,GAAG,2BAA2B,CAAC;AAC3C,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAEpD,SAAS,eAAe;IACtB,qGAAqG;IACrG,MAAM,UAAU,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,I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E,EAAE,CAC7D,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAC7B,CAAC;IAEF,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,gEAAgE;IAChE,6DAA6D;IAC7D,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;QAC3B,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC5B,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,4BAA4B,GAAG,IAAI,CAAC,CAAC;IAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@kraph/mcp-stdio",
3
+ "version": "0.1.0",
4
+ "description": "Stdio MCP shim for Kraph — bridges a local MCP stdio client (Claude Desktop, Cursor, etc.) to Kraph's hosted HTTP MCP endpoint at api.kraph.com/mcp. Use when your MCP host doesn't speak Streamable HTTP transport directly.",
5
+ "type": "module",
6
+ "bin": {
7
+ "kraph-mcp-stdio": "./dist/index.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "files": [
11
+ "dist",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsc",
17
+ "prepublishOnly": "tsc"
18
+ },
19
+ "keywords": [
20
+ "mcp",
21
+ "model-context-protocol",
22
+ "kraph",
23
+ "supabase",
24
+ "stdio",
25
+ "claude",
26
+ "anthropic"
27
+ ],
28
+ "author": "Kraph",
29
+ "license": "MIT",
30
+ "homepage": "https://kraph.com",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/kraph-com/kraph.git",
34
+ "directory": "packages/mcp-stdio"
35
+ },
36
+ "engines": {
37
+ "node": ">=18"
38
+ },
39
+ "dependencies": {
40
+ "@modelcontextprotocol/sdk": "^1.0.0"
41
+ },
42
+ "devDependencies": {
43
+ "@types/node": "^20",
44
+ "typescript": "^5.7.0"
45
+ }
46
+ }