@caffeineai/mcp 0.1.0-dev.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 @@
1
+ © Caffeine Labs AG. All rights reserved. Use is subject to the Caffeine AI [Terms of Use](https://caffeine.ai/terms-of-use)
package/README.md ADDED
@@ -0,0 +1,183 @@
1
+ # @caffeineai/mcp
2
+
3
+ MCP server that gives AI coding tools access to Caffeine projects.
4
+
5
+ ## Development Release
6
+
7
+ This is a DEV release. It is published under the npm `dev` dist-tag and is subject to a rapid release cadence. Expect frequent updates while the CLI and MCP packages settle.
8
+
9
+ Once installed and authenticated, your agent can list, clone, build, check, and preview Caffeine projects from inside your editor.
10
+
11
+ ## Prerequisites
12
+
13
+ 1. Node.js 20 or later.
14
+ 2. `@caffeineai/cli` signed in once. The MCP server reuses the CLI's OS credential-store login.
15
+
16
+ ```bash
17
+ npm install -g @caffeineai/cli@dev
18
+ caffeine auth login
19
+ ```
20
+
21
+ ## Pre-Warm The Package Cache
22
+
23
+ The published package contains a native binary. `npx -y` caches it after the first download, but the first invocation often happens inside an MCP host process with a startup timeout. On a slow connection the host can mark the server as offline before the download finishes.
24
+
25
+ Run this once in a terminal before relying on the server from any host:
26
+
27
+ ```bash
28
+ npx -y @caffeineai/mcp@dev --version
29
+ ```
30
+
31
+ After that, hosts on the same machine start the server from cache. Subsequent runs only re-download when a newer dev version has been published.
32
+
33
+ ## Install Into Your Host
34
+
35
+ All snippets below use the stdio transport with `npx -y @caffeineai/mcp@dev` as the command.
36
+
37
+ ### Claude Code
38
+
39
+ User-wide:
40
+
41
+ ```bash
42
+ claude mcp add --transport stdio --scope user caffeine -- npx -y @caffeineai/mcp@dev
43
+ ```
44
+
45
+ Project-wide, in `.mcp.json`:
46
+
47
+ ```json
48
+ {
49
+ "mcpServers": {
50
+ "caffeine": {
51
+ "command": "npx",
52
+ "args": ["-y", "@caffeineai/mcp@dev"]
53
+ }
54
+ }
55
+ }
56
+ ```
57
+
58
+ Inside Claude Code, type `/mcp` to see server status.
59
+
60
+ ### Cursor
61
+
62
+ `.cursor/mcp.json` for a project, or `~/.cursor/mcp.json` globally:
63
+
64
+ ```json
65
+ {
66
+ "mcpServers": {
67
+ "caffeine": {
68
+ "type": "stdio",
69
+ "command": "npx",
70
+ "args": ["-y", "@caffeineai/mcp@dev"]
71
+ }
72
+ }
73
+ }
74
+ ```
75
+
76
+ Restart Cursor after adding the config.
77
+
78
+ ### VS Code With GitHub Copilot
79
+
80
+ ```bash
81
+ code --add-mcp '{"name":"caffeine","command":"npx","args":["-y","@caffeineai/mcp@dev"]}'
82
+ ```
83
+
84
+ Or `.vscode/mcp.json`:
85
+
86
+ ```json
87
+ {
88
+ "servers": {
89
+ "caffeine": {
90
+ "type": "stdio",
91
+ "command": "npx",
92
+ "args": ["-y", "@caffeineai/mcp@dev"]
93
+ }
94
+ }
95
+ }
96
+ ```
97
+
98
+ Verify via the command palette: `MCP: List Servers`.
99
+
100
+ ### OpenAI Codex
101
+
102
+ ```bash
103
+ codex mcp add caffeine -- npx -y @caffeineai/mcp@dev
104
+ ```
105
+
106
+ Or `~/.codex/config.toml`:
107
+
108
+ ```toml
109
+ [mcp_servers.caffeine]
110
+ command = "npx"
111
+ args = ["-y", "@caffeineai/mcp@dev"]
112
+ ```
113
+
114
+ Verify with `codex mcp list`.
115
+
116
+ ### Windsurf
117
+
118
+ `~/.codeium/windsurf/mcp_config.json`:
119
+
120
+ ```json
121
+ {
122
+ "mcpServers": {
123
+ "caffeine": {
124
+ "command": "npx",
125
+ "args": ["-y", "@caffeineai/mcp@dev"]
126
+ }
127
+ }
128
+ }
129
+ ```
130
+
131
+ Quit and reopen Windsurf after adding the config.
132
+
133
+ ## Available Tools
134
+
135
+ | Tool | Description |
136
+ | --- | --- |
137
+ | `caffeine_auth_login` | Start a login flow |
138
+ | `caffeine_auth_logout` | Log out and clear local credentials |
139
+ | `caffeine_auth_status` | Check authentication status |
140
+ | `caffeine_list_projects` | List your projects |
141
+ | `caffeine_show_project` | Get project details |
142
+ | `caffeine_create_project` | Create a project |
143
+ | `caffeine_delete_project` | Delete a project |
144
+ | `caffeine_clone_project` | Clone a project locally |
145
+ | `caffeine_import_project` | Import a project from a .zip |
146
+ | `caffeine_export_project` | Export the current project to a .zip |
147
+ | `caffeine_build` | Build the project |
148
+ | `caffeine_check` | Validate code and configuration |
149
+ | `caffeine_preview` | Upload a built project as a draft |
150
+ | `caffeine_doctor` | Diagnose the local toolchain |
151
+ | `caffeine_config_list` / `caffeine_config_get` / `caffeine_config_set` | Manage CLI config |
152
+
153
+ All tools return the same stable `{ ok, data }` / `{ ok, error }` envelope used by the CLI's `--json` mode.
154
+
155
+ ## Supported Platforms
156
+
157
+ Native binaries ship for:
158
+
159
+ - macOS arm64 and x64
160
+ - Linux arm64 and x64, glibc and musl
161
+ - Windows arm64 and x64
162
+
163
+ ## Troubleshooting
164
+
165
+ - **Server shows as offline on first use.** Run `npx -y @caffeineai/mcp@dev --version` in a terminal, then restart your host.
166
+ - **Not logged in errors.** Run `caffeine auth login` via the CLI. The MCP server does not have a separate login.
167
+ - **Config changes not taking effect.** Most hosts do not hot-reload MCP configs. Restart the host after editing MCP config files.
168
+ - **`command not found: npx`.** Install Node.js 20+ and ensure `npx` is on your `PATH`.
169
+
170
+ ## Quick Transport Check
171
+
172
+ With no host running, you can pipe a JSON-RPC request directly:
173
+
174
+ ```bash
175
+ echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | npx -y @caffeineai/mcp@dev
176
+ ```
177
+
178
+ ## Links
179
+
180
+ - Caffeine platform: https://caffeine.ai
181
+ - Model Context Protocol: https://modelcontextprotocol.io
182
+
183
+ This package installs the matching platform binary through npm optional dependencies. Install the main package rather than a platform package directly.
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { spawn, spawnSync } = require("node:child_process");
5
+
6
+ const packages = {
7
+ "darwin-arm64": {
8
+ "packageName": "@caffeineai/mcp-darwin-arm64",
9
+ "binary": "caffeine-mcp"
10
+ },
11
+ "darwin-x64": {
12
+ "packageName": "@caffeineai/mcp-darwin-x64",
13
+ "binary": "caffeine-mcp"
14
+ },
15
+ "linux-arm64-glibc": {
16
+ "packageName": "@caffeineai/mcp-linux-arm64-glibc",
17
+ "binary": "caffeine-mcp"
18
+ },
19
+ "linux-x64-glibc": {
20
+ "packageName": "@caffeineai/mcp-linux-x64-glibc",
21
+ "binary": "caffeine-mcp"
22
+ },
23
+ "linux-arm64-musl": {
24
+ "packageName": "@caffeineai/mcp-linux-arm64-musl",
25
+ "binary": "caffeine-mcp"
26
+ },
27
+ "linux-x64-musl": {
28
+ "packageName": "@caffeineai/mcp-linux-x64-musl",
29
+ "binary": "caffeine-mcp"
30
+ },
31
+ "win32-arm64": {
32
+ "packageName": "@caffeineai/mcp-win32-arm64",
33
+ "binary": "caffeine-mcp.exe"
34
+ },
35
+ "win32-x64": {
36
+ "packageName": "@caffeineai/mcp-win32-x64",
37
+ "binary": "caffeine-mcp.exe"
38
+ }
39
+ };
40
+
41
+ function linuxLibc() {
42
+ if (process.platform !== "linux") return "";
43
+
44
+ try {
45
+ const report = process.report && process.report.getReport && process.report.getReport();
46
+ if (report && report.header && report.header.glibcVersionRuntime) return "glibc";
47
+ } catch {}
48
+
49
+ try {
50
+ const result = spawnSync("ldd", ["--version"], { encoding: "utf8" });
51
+ const text = String(result.stdout || "") + String(result.stderr || "");
52
+ if (text.toLowerCase().includes("musl")) return "musl";
53
+ } catch {}
54
+
55
+ return "glibc";
56
+ }
57
+
58
+ function platformKey() {
59
+ switch (process.platform) {
60
+ case "darwin":
61
+ return `darwin-${process.arch}`;
62
+ case "linux":
63
+ return `linux-${process.arch}-${linuxLibc()}`;
64
+ case "win32":
65
+ return `win32-${process.arch}`;
66
+ default:
67
+ return "";
68
+ }
69
+ }
70
+
71
+ const key = platformKey();
72
+ const selected = packages[key];
73
+
74
+ if (!selected) {
75
+ console.error("caffeine-mcp: unsupported platform " + process.platform + "/" + process.arch);
76
+ process.exit(1);
77
+ }
78
+
79
+ let bin;
80
+ try {
81
+ bin = require.resolve(selected.packageName + "/bin/" + selected.binary);
82
+ } catch {
83
+ console.error("caffeine-mcp: missing platform package " + selected.packageName);
84
+ console.error("Reinstall without --omit=optional.");
85
+ process.exit(1);
86
+ }
87
+
88
+ const child = spawn(bin, process.argv.slice(2), { stdio: "inherit" });
89
+
90
+ child.on("exit", (code, signal) => {
91
+ if (signal) {
92
+ console.error("caffeine-mcp: terminated by " + signal);
93
+ process.exit(1);
94
+ }
95
+
96
+ process.exit(code ?? 0);
97
+ });
98
+
99
+ child.on("error", (err) => {
100
+ console.error(err.message);
101
+ process.exit(1);
102
+ });
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@caffeineai/mcp",
3
+ "version": "0.1.0-dev.0",
4
+ "description": "Caffeine MCP server",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/caffeinelabs/caffeine-cli.git"
8
+ },
9
+ "license": "SEE LICENSE IN LICENSE",
10
+ "bin": {
11
+ "caffeine-mcp": "bin/caffeine-mcp.js"
12
+ },
13
+ "files": [
14
+ "bin",
15
+ "README.md",
16
+ "LICENSE"
17
+ ],
18
+ "optionalDependencies": {
19
+ "@caffeineai/mcp-darwin-arm64": "0.1.0-dev.0",
20
+ "@caffeineai/mcp-darwin-x64": "0.1.0-dev.0",
21
+ "@caffeineai/mcp-linux-arm64-glibc": "0.1.0-dev.0",
22
+ "@caffeineai/mcp-linux-x64-glibc": "0.1.0-dev.0",
23
+ "@caffeineai/mcp-linux-arm64-musl": "0.1.0-dev.0",
24
+ "@caffeineai/mcp-linux-x64-musl": "0.1.0-dev.0",
25
+ "@caffeineai/mcp-win32-arm64": "0.1.0-dev.0",
26
+ "@caffeineai/mcp-win32-x64": "0.1.0-dev.0"
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ }
31
+ }