🎃 Build an `amcp` CLI (MVP): log in with an API key, list and call tools
Maintainer thường phản hồi trong vòng 1 ngày
@Coding-Professional đang làm issue này rồi.
Từ ngày 11/10/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
Start with the new packages/cli workspace, the root package.json workspaces and the Docker COPY lines at Dockerfile:26-32, then read mcp-combined-auth.guard.ts:61-85 for how X-API-Key is accepted and mcp-client.engine.ts:46 for the existing StreamableHTTP transport. Done means amcp login, tools ls, tools describe and tools call work against /mcp/<serverId>, the node --test suite passes with the key kept out of output, and docker build . still succeeds.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Part of the October Challenge #997.
Why
Developers want to test a connector's tools from the terminal or a CI job ("does sap_query still answer after the upgrade?") without opening the UI or wiring up an MCP client. A small CLI that talks to the MCP endpoint we already expose is enough, and it works the same against AnythingMCP Cloud and any self-hosted instance. Comparable tools: mcp-cli, the MCP Inspector CLI mode, Composio's CLI.
Self-hosted vs Cloud
- Self-hosted: works with per-user MCP API keys (
mcp_…) and with the instance-wideMCP_API_KEY/MCP_BEARER_TOKENused inlegacyauth mode. - Cloud (
DEPLOYMENT_MODE=cloud): works with per-user MCP API keys. Important difference: on Cloud the bare/mcpURL serves a fixed set of 8 meta-tools (anythingmcp_search_tools,anythingmcp_run_read_tool, …, seeshared-toolset.ts:26and:52), not the workspace's tools. The CLI must therefore always target a server URL/mcp/<serverId>, which exposes that server's tools directly on both deployments. - Who can use it: any member who can create an MCP API key. The backend already scopes everything: the key resolves to a user and organization, the per-server endpoint checks org membership (
mcp-endpoint.controller.ts:837–871) and the user's MCP role limits which tools are listed and callable. The CLI adds no permissions of its own.
What to build
New workspace package packages/cli (@anythingmcp/cli, "bin": { "amcp": "dist/index.js" }, TypeScript, Node ≥ 22.12 like the root engines).
- Transport:
@modelcontextprotocol/clientv2 (already used by the backend) withStreamableHTTPClientTransport, headerX-API-Key: <key>. One small dependency for argument parsing (commanderor Node's built-inutil.parseArgs); nothing else. - Commands:
amcp login --url https://cloud.anythingmcp.com --server <serverId>— reads the key from a hidden prompt or--key-stdin(never as a plain argument, it would land in shell history), callstools/listonce to verify, saves a profile to~/.config/amcp/config.json($XDG_CONFIG_HOMErespected, file mode0600).--profile <name>for several instances.amcp logout,amcp whoami(URL, server id, key prefixmcp_ab12…only).amcp tools ls [--filter <text>]— name, read-only/destructive hint (from tool annotations), first line of description.amcp tools describe <name>— description + input JSON schema.amcp tools call <name> --args '<json>'(or--args @file.json, or-for stdin). Prints text content; if a tool annotation saysdestructiveHint: trueand stdin is a TTY, ask for confirmation unless--yes.- Global
--json(machine-readable output for every command),--profile,--url/--server/AMCP_URL/AMCP_API_KEY/AMCP_SERVERenv overrides for CI.
- Exit codes:
0ok,1tool returnedisError,2usage/invalid JSON,3auth (401/403),4network/server error. Errors to stderr; never print the key or full request headers, even with--verbose. - Workspace wiring: add
packages/clito rootpackage.jsonworkspaces; give itbuild,lintandtestscripts. The Docker build runsnpm ciwith only the backend/frontendpackage.jsoncopied (Dockerfile:26–32); verifydocker build .still works and adjust the COPY lines if needed. The CLI must not end up in the server image.
Where to look
package.json(root) —workspaces,engines,test/lintscripts.docs/api-reference.md:3— the REST API under/api/*requires a JWT, not an MCP API key;:286MCP API keys.packages/backend/src/auth/mcp-combined-auth.guard.ts:61–85— howX-API-Key(mcp_…or static key) is accepted.packages/backend/src/mcp-server/mcp-endpoint.controller.ts:222(bare/mcp),:676(/mcp/:serverId).packages/backend/src/mcp-server/shared-toolset.ts:52—sharedEndpointMode(), why bare/mcpdiffers on Cloud.packages/backend/src/connectors/engines/mcp-client.engine.ts:46— existingStreamableHTTPClientTransportusage with custom headers.packages/frontend/src/app/mcp-server/[id]/page.tsx:270,:297— where users find the server URL and theX-API-Keyheader; add a "CLI" snippet there in a follow-up.packages/backend/prisma/schema.prisma:344—McpApiKey(optionally bound to onemcpServerId).
Acceptance criteria
- Tests with
node --test(or jest like the backend) against an in-process fake MCP server (@modelcontextprotocol/server):tools ls,tools callsuccess,isError, 401, invalid--argsJSON,--jsonoutput shape. - Config file is created
0600; the key never appears in stdout/stderr (test it). - Manually verified against a local
docker compose upinstance and against Cloud (put the commands/output, key redacted, in the PR). - The backend and frontend tests and lint still pass;
docker build .still passes. - Docs:
packages/cli/README.md+ a "CLI" section indocs/api-reference.md.
Out of scope
amcp servers ls/ connector management: there is no endpoint that lists MCP servers for an API key (/api/mcp-serversis JWT-only,mcp-servers.controller.ts:92). Follow-up: a maintainer-designed read-only endpoint, then the command.- OAuth device-flow / browser login, email+password login.
- Publishing to npm, Homebrew, standalone binaries.
- Resources and prompts (
resources/list,prompts/get), interactive REPL, shell completions.
Size
L (several days, may be split: package skeleton + login/tools ls first, tools call + --json second).
How to claim
Comment "I'd like to work on this" and we'll assign you. Rules in #997.
- Ngôn ngữ chính
- TypeScript
- Star
- 856
- Fork
- 82
- Merge trung bình
- 6 giờ 44 phút
- Pull request đã merge (30 ngày)
- 181
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của HelpCode-ai/anythingmcp
-
Docs: document all SMTP_* and other undocumented env vars for self-hostingCó thể đã có người làm @notlakshitha đã nhận 5 ngày trước. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
HelpCode-ai/anythingmcp#1049 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue hacktoberfest
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 70/100
HelpCode-ai/anythingmcp#996 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue hacktoberfest
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
HelpCode-ai/anythingmcp#995 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue hacktoberfest help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
HelpCode-ai/anythingmcp#982 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Workspace memory: personal and organization memory for AI clientsCó thể đã có người làm @helpcodeai đã nhận hôm nay. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
HelpCode-ai/anythingmcp#1151 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của HelpCode-ai/anythingmcp
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
radix-ui/primitives#4228 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
SignalK/freeboard-sk#1093 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[测试] 等待仓库加载后再记录多仓库排序基线Có thể đã có người làm @myot233 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày