mirror of
https://github.com/bitbaum/orangecat.git
synced 2026-12-06 09:17:33 +01:00
* fix(mcp-servers): six of seven servers never started; convert them to ESM
mcp-servers/package.json declares "type": "module", but fs, git, lint,
shell, supabase and vitest called require() and died on their first line
with "require is not defined in ES module scope". Only github-server.js,
which already used import, ran. They now use ESM imports, as
github-server.js does. The "plain CommonJS" lint waiver in two of them
was wrong and is removed, along with fs-server's unused fsSync import.
Once they started, every tool call that returned data failed too: the
results were { type: 'json', json: ... }, which is not an MCP content
type, so the SDK rejected them (-32602). They now return
{ type: 'text', text: JSON.stringify(..., null, 2) }, as github-server
does.
fs-server imports glob and supabase-server imports @supabase/supabase-js,
but neither was declared, so they resolved from the app's node_modules
only when it happened to be installed. Both are now declared. glob is
^14.0.3, because glob 11 carries GHSA-3g3m-2fjr-6pw4 and the minimatch
advisory; list_files works unchanged on 14.
New mcp-servers/smoke.mjs (npm run smoke): starts every *-server.js,
sends initialize, notifications/initialized and tools/list over stdio,
and calls one read-only tool on fs, git, lint and shell. Main: 1/7.
This branch: 7/7.
The rest of the diff in these files is eslint --fix and prettier, which
lint-staged applies to any staged file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
* fix(mcp-servers): close stat-then-read race in fs-server (CodeQL)
read_file stat()ed the path, then readFile()d it again by name, so the
size check could apply to a different file than the one read (CodeQL
js/file-system-race, high). It now opens one handle and stats and reads
through it. delete_file had the same stat-then-unlink shape. unlink
never removes a directory, so it now calls unlink directly and maps
ENOENT to not_found and EISDIR/EPERM to the old refusal.
Checked over MCP: read ok, too-large refused, missing file errors,
delete ok then not_found, directory refused, path escape refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
---------
Co-authored-by: Claude <noreply@anthropic.com>
2.9 KiB
2.9 KiB
MCP Servers Setup
1. Install Dependencies
cd mcp-servers
npm install
npm run smoke # starts every server and checks it answers MCP over stdio
2. GitHub Server
Create a GitHub Personal Access Token and expose it as GITHUB_TOKEN.
- Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
- Generate new token with these permissions:
repo(Full control of private repositories)actions(Actions access)admin:repo_hook(Repository hooks)
Set Environment Variable
export GITHUB_TOKEN="your_github_token_here"
Or create a .env file:
GITHUB_TOKEN=your_github_token_here
3. Configure Claude Desktop (example)
Add to your Claude Desktop config file (~/AppData/Roaming/Claude/claude_desktop_config.json on Windows):
{
"mcpServers": {
"github": {
"command": "node",
"args": ["/path/to/orangecat/mcp-servers/github-server.js"],
"env": { "GITHUB_TOKEN": "your_github_token_here" }
},
"fs": {
"command": "node",
"args": ["/path/to/orangecat/mcp-servers/fs-server.js"]
},
"shell": {
"command": "node",
"args": ["/path/to/orangecat/mcp-servers/shell-server.js"]
},
"git": {
"command": "node",
"args": ["/path/to/orangecat/mcp-servers/git-server.js"]
},
"lint": {
"command": "node",
"args": ["/path/to/orangecat/mcp-servers/lint-server.js"]
},
"vitest": {
"command": "node",
"args": ["/path/to/orangecat/mcp-servers/vitest-server.js"]
},
"supabase": {
"command": "node",
"args": ["/path/to/orangecat/mcp-servers/supabase-server.js"],
"env": {
"NEXT_PUBLIC_SUPABASE_URL": "...",
"NEXT_PUBLIC_SUPABASE_ANON_KEY": "...",
"SUPABASE_SERVICE_ROLE_KEY": "optional"
}
}
}
}
4. Test Servers
cd mcp-servers
node github-server.js # GitHub
node fs-server.js # Filesystem (workspace-restricted)
node shell-server.js # Shell (allowlist)
node git-server.js # Git
node lint-server.js # ESLint/Prettier
node vitest-server.js # Vitest
node supabase-server.js # Supabase
5. Available Tools (highlights)
Once configured, you'll have access to these tools in Claude/Codex:
- GitHub: repository/PRs/actions/secrets management
- FS: read/write/list/move/delete files within workspace
- Shell: run allowlisted commands (npm, next, vitest, eslint, prettier, rg)
- Git: status/diff/branch/checkout/add/commit/push
- Lint: eslint check/fix, prettier check/write
- Jest: run tests by pattern or file
- Supabase: select/insert/update/count rows
6. Example Usage
After setup, you can ask Claude to:
- "Check the status of my latest GitHub Actions"
- "Add a new repository secret"
- "What are the current status checks for my latest commit?"
- "Trigger the deployment workflow"
The server will handle all GitHub API interactions automatically!