mcp-server-typescript
Skill18k starsChanged 2 months agoMITView on GitHub
Things that aren't obvious from the docs and tend to cost debugging time. The Claude you're typing to in Desktop is a relay. It calls send_message with your words, calls wait_for_idle to block until the managed agent finishes, then shows you the reply. The work itself (tool use, code execution, repo edits) happens in the Managed Agents session, not in Desktop. list_agents, get_agent, create_session, send_message, interrupt, get_session, list_events, archive_session are straight endpoint wrappers. wait_for_idle is the only editorial: MCP is…
- Reads credentials
1 other project uses a version of this.
Trending
More talk lately.about the whole repository
Most recently taken up by
- kingsidharth/skillstheir own version, first seen Mar 16, 2026
Who's talking about anthropics/claude-quickstarts
- @github-trending-js.bsky.social“🚀 Skyrocketing! 🚀 (200+ new stars) 📦 anthropics / claude-quickstarts ⭐ 18,532 (+453) 🗒 TypeScript A …”Bluesky · Oct 18, 2026 · 2 likes
- phananhtuan09/ai-agent-workflow“[Feature] runtime-e2e-test: setup mode that detects, proves, and fills project-runtime.md”GitHub · Nov 2, 2026
- MoradDev/skills-unified“Upstream updates to review”GitHub · Nov 1, 2026
- melodic-software/claude-code-plugins“docs(playbooks): re-anchor skill-authoring and fable-5 verification to the claude.dev blog posts”GitHub · Oct 31, 2026
- totalolage/deskohub-site“Run agent task evals against previews”GitHub · Oct 17, 2026
The biggest 5 of 23 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 23
Talked about on GitHub and Bluesky (23 times).
On GitHub · 22
- Nov 2, 2026[Feature] runtime-e2e-test: setup mode that detects, proves, and fills project-runtime.md — phananhtuan09/ai-agent-workflow0 reactions
- Nov 1, 2026Upstream updates to review — MoradDev/skills-unified0 reactions
- Oct 31, 2026docs(playbooks): re-anchor skill-authoring and fable-5 verification to the claude.dev blog posts — melodic-software/claude-code-plugins0 reactions · 4 comments
- Oct 17, 2026Run agent task evals against previews — totalolage/deskohub-site0 reactions · 1 comment
- Sep 25, 2026agent-skills.github.anthropics.claude-quickstarts: init at 0-unstable-2026-08-21 — sudosubin/agents.nix0 reactions
17 more on GitHub
- Sep 23, 2026docs(managed_agents): move the self-hosted sandbox variants to claude-quickstarts — anthropics/claude-cookbooks0 reactions · 2 comments
- Sep 21, 2026docs(managed_agents): move the Linear, road trip planner, and MCP server apps to claude-quickstarts — anthropics/claude-cookbooks0 reactions · 2 comments
- Sep 16, 2026docs(managed_agents): move the Slack and Sentry apps to claude-quickstarts — anthropics/claude-cookbooks0 reactions
- Sep 16, 2026docs(managed_agents): move the Slack and Sentry apps to claude-quickstarts — anthropics/claude-cookbooks0 reactions · 2 comments
- Sep 15, 2026Factory.ai 深度调研报告 — Pines-Cheng/blog0 reactions
- Sep 13, 2026/automations: real product widgets + trademark disclaimer — clancybooher/peak-view-windows0 reactions · 1 comment
- Aug 2, 2026goal-maker/bhag: adopt Anthropic's long-run harness (immutable feature_list.json + append-only progress file + fixed bootstrap drill) — jackneil/claude-jacked0 reactions
- Feb 17, 2026Closing the loop - Infrastructure for Agentic Engineering — schemalabz/opencouncil0 reactions
- Feb 3, 2026[Feature] Add Session Persistence, Security Model, and Progress Tracking (v2.2.0) — jnPiyush/AgentX0 reactions · 4 comments
- Jan 13, 2026feat: Add support for ANTHROPIC_API_KEY authentication — nirmalarya/claude-harness0 reactions
- Jan 2, 2026Meta-Library Architecture: Transform Any AI Workflow Knowledge into Executable FSMs — JulesGosnell/claij0 reactions
- Jan 2, 2026Learn from Anthropic's Long-Running Harness Pattern — JulesGosnell/claij0 reactions
- Jan 1, 2026Does this work with Anthropics new Harness for long running agent strategy? — rubycatco/claude-agent-sdk-ruby0 reactions · 2 comments
- Dec 23, 2025Add a think tool — byronxlg/polyagent0 reactions
- Dec 11, 2025feat: Add Autonomous Claude Code Builder system — krzemienski/shannon-framework0 reactions · 2 comments
- Dec 6, 2025Clone Anthropic computer-use-demo into repository — matheus-rech/comp-use0 reactions · 2 comments
- Nov 10, 2025File Editor Tool — strands-agents/sdk-typescript0 reactions · 7 comments
On Bluesky · 1
- Oct 18, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 anthropics / claude-quickstarts ⭐ 18,532 (+453) 🗒 TypeScript A collection of projects designed to… — @github-trending-js.bsky.social2 likes and reposts · 1 reply
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- kingsidharth/skills★ 17same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- managed-agents/assistant-ui/CLAUDE.mdCLAUDE.md
- managed-agents/chat-sdk/CLAUDE.mdCLAUDE.md
- managed-agents/copilot-kit-ag-ui/CLAUDE.mdCLAUDE.md
- managed-agents/daily-brief/CLAUDE.mdCLAUDE.md
- managed-agents/knowledge-wiki/CLAUDE.mdCLAUDE.md
- managed-agents/linear/CLAUDE.mdCLAUDE.md
- managed-agents/mcp-server-typescript/CLAUDE.mdCLAUDE.md
- managed-agents/roadtrip-planner/CLAUDE.mdCLAUDE.md
- managed-agents/self-hosted-sandboxes/CLAUDE.mdCLAUDE.md
- managed-agents/sentry/CLAUDE.mdCLAUDE.md
- managed-agents/slack/CLAUDE.mdCLAUDE.md
- first-runSkill
- verifySkill
- assistant-uiSkill
- chat-sdkSkill
- verifySkill
- knowledge-wikiSkill
- linearSkill
- roadtrip-plannerSkill
- sentrySkill
- slackSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Agents: if the workspace has none, run ./agents/setup.sh in ../slack or ../chat-sdk.
- Very specific: line 44
Or with Claude Desktop: add this to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) and restart Desktop.
- Very specific: line 109
Every tool that takes a session_id retrieves the session first and refuses unless its agent is on the list.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Setup tips & tricks: Claude Managed Agents as an MCP server
Things that aren't obvious from the docs and tend to cost debugging time.
Mental model
Claude Desktop is the frontend, Managed Agents is the backend
The Claude you're typing to in Desktop is a relay. It calls send_message with your words, calls wait_for_idle to block until the managed agent finishes, then shows you the reply. The work itself (tool use, code execution, repo edits) happens in the Managed Agents session, not in Desktop.
Eight 1:1 tools, one shim
list_agents, get_agent, create_session, send_message, interrupt, get_session, list_events, archive_session are straight endpoint wrappers. wait_for_idle is the only editorial: MCP is request/response and a Managed Agents turn completes over SSE, so something has to stream-to-idle inside a tool call.
session_id is the only state, and Claude holds it
create_session returns it, and Claude passes it to every later call. The MCP server itself is stateless.
Two transports, one tool set
src/tools.ts registers the nine tools. src/server.ts wraps it in stdio (Claude Desktop or Claude Code spawns it as a subprocess). src/server-http.ts wraps it in Streamable HTTP (claude.ai reaches it over the network). Pick one.
No agents are created here
This server drives the agents already in your workspace. Create and update them with the ant CLI, the Console, or another quickstart's ./agents/setup.sh. The one resource it needs is an environment, because sessions.create takes an environment_id. environment.yaml defines it.
Setup: Claude Desktop or Claude Code (stdio, local)
- Auth and environment (one time):
ant auth login # or: cp .env.example .env and set ANTHROPIC_API_KEY printf 'CLAUDE_ENVIRONMENT_ID=%s\n' \ "$(ant beta:environments create --transform id --raw-output < environment.yaml)" >> .env - Agents: if the workspace has none, run
./agents/setup.shin../slackor../chat-sdk. Optionally list the IDs you want reachable inALLOWED_AGENT_IDSin.env. - Register with Claude Code:
Or with Claude Desktop: add this toclaude mcp add managed-agents -- bun --env-file="$PWD/.env" run "$PWD/src/server.ts"~/Library/Application Support/Claude/claude_desktop_config.json(macOS) and restart Desktop. Desktop does not read your shell's environment or.env, so the values go in theenvblock:{ "mcpServers": { "managed-agents": { "command": "/absolute/path/to/bun", "args": ["run", "/absolute/path/to/managed-agents/mcp-server-typescript/src/server.ts"], "env": { "ANTHROPIC_API_KEY": "<your key>", "CLAUDE_ENVIRONMENT_ID": "<from step 1>" } } } } - Test: in a new chat, ask "list my managed agents, start a session with the first one, and relay this message to it: hello."
Setup: claude.ai (Streamable HTTP, remote)
Same tools, but the server runs at a public URL and claude.ai connects to it as a custom connector. Read "What the token can reach" below before step 3.
- Token: generate it and keep it. The server refuses to start without one of at least 32 characters.
echo "MANAGED_AGENTS_MCP_TOKEN=$(openssl rand -hex 32)" >> .env - Run locally first:
To test through a tunnel (ngrok, cloudflared), add the tunnel's hostname tobun run http # http://127.0.0.1:3000/mcpALLOWED_HOSTS. The server answers 421 to anyHostheader it wasn't told about. - Deploy: the
Dockerfiletargets Fly, Railway, Render, and Cloud Run. SetANTHROPIC_API_KEY,CLAUDE_ENVIRONMENT_ID,MANAGED_AGENTS_MCP_TOKEN,ALLOWED_HOSTS, andALLOWED_AGENT_IDSas secrets on the platform. The image setsHOST=0.0.0.0, and the server will not start on a non-loopback host untilALLOWED_HOSTSnames the public hostname. Terminate TLS in front of it. Cloudflare Workers also works:WebStandardStreamableHTTPServerTransportis fetch-native, so swapprocess.envforenvandBun.serveforexport default { fetch }. claude.ai → Settings → Connectors → Add custom connector:
Field Value Name Managed AgentsURL https://<your-deploy>/mcpAuthentication Bearer token → your MANAGED_AGENTS_MCP_TOKENTeam and Enterprise orgs: adding a connector by URL is typically org-admin only. Individual users see a curated directory, not a URL field. An admin adds the URL and token once in org settings, and it then appears in every member's connector list to enable. That is the shape you want for rolling out to non-technical users anyway.
- Test: new chat → enable the connector → same prompt as above.
Relay mode (recommended Project instructions)
Without guidance, the frontend Claude will try to answer the user itself instead of relaying. Put this in a Project's custom instructions:
You are a frontend for a backend Managed Agent reached through the
managed-agentsMCP tools. On the first user turn:list_agents(if needed) →create_session→send_message(user text verbatim)→wait_for_idle→ return thereplyverbatim. On later turns:send_message→wait_for_idle. Do not answer from your own knowledge, and do not paraphrase the backend's reply. Ifwait_for_idlereturnsstatus: "timeout", tell the user it's still running and offer to keep waiting. If it returns any status other than"idle"or"timeout", tell the user the turn stopped early and give the status.
Gotchas
What the token can reach
The caller of these tools is a model, and whoever holds the bearer token is whoever can talk to that model. The server's Anthropic credentials can see every agent and every session in the workspace. With no allowlist, so can the caller: list_agents enumerates them, get_agent returns their full system prompts and tool configs, create_session runs any of them on your bill, and any session_id the caller learns or guesses can be read, messaged, interrupted, or archived.
ALLOWED_AGENT_IDS narrows all of that to the agents you name:
list_agentsfetches exactly those agents and nothing else.get_agentandcreate_sessionrefuse any otheragent_id.- Every tool that takes a
session_idretrieves the session first and refuses unless its agent is on the list. That check runs before the send, interrupt, archive, or stream. - A refusal says "not available through this server" whether or not the ID exists.
The check lives in one place, src/scope.ts, and src/tools.ts runs it from the scope each tool declares at registration. A tool whose scope doesn't match its schema throws when the server starts.
Two more layers, both independent of the allowlist: every ID is matched against agent_… / sesn_… / sevt_… before it reaches the API, so a model-supplied string never becomes a URL path segment unchecked. And for production, give the server an API key from a dedicated workspace that holds only the agents it should serve. Then the workspace boundary does the scoping and the allowlist is the second line.
stdio = your machine, HTTP = the network
Browser claude.ai can't spawn a local process, so stdio only works with Claude Desktop and Claude Code. The HTTP path gets you claude.ai, but now the URL is public and the bearer token is the gate in front of everything above. The server compares it in constant time, never logs it, and answers a wrong one with a bare 401. Don't deploy without TLS, and rotate the token like any API key.
The Host and Origin checks
src/server-http.ts answers 421 unless the Host header is one it was told about: the loopback names by default, or ALLOWED_HOSTS. It answers 403 to any request that carries an Origin header not in ALLOWED_ORIGINS. Server-to-server MCP clients send no Origin, so this only stops browsers. Together they close DNS rebinding against a server running on your laptop, where a web page you visit resolves its own hostname to 127.0.0.1 and talks to your local port.
Replies are untrusted text
wait_for_idle and list_events hand the backend agent's words to the frontend model. That agent may have read web pages or repo files, so treat its output as data. The tools return it inside a JSON text block, the tool descriptions are fixed strings, and list_events clips each field at 4,000 characters and returns a page of at most 500 events. The relay instructions above tell the frontend to pass the reply through, not to act on it.
idle means finished, and nothing else does
wait_for_idle returns status: "idle" only when the agent ended its turn. requires_action means it is parked on a tool approval or a custom tool result that this server has no way to supply. retries_exhausted and budget_reached mean it gave up or hit its cap. terminated means the session is gone. In each of those, reply may hold a half-finished preamble. timeout means it is still running.
Long turns vs tool timeout
wait_for_idle blocks, and the deadline is real: a timer drops the stream at timeout_sec even if the session emits nothing. If the agent runs for minutes (big repo clone, many tool calls), the MCP client may time out the tool call first. Mitigations: pass a smaller timeout_sec and loop (status: "timeout" comes with last_event_id, so call again), or have Claude poll get_session + list_events(after_id=...).
Over HTTP there is a second clock. Nothing is written to the response while the agent works, and Bun closes a connection that has been silent for idleTimeout seconds (10 by default). Proxies and load balancers do the same. src/server-http.ts sets the transport's SSE keep-alive comment to every 5 seconds and Bun's idleTimeout to 30, so a quiet wait survives. If a proxy in front of your deploy still cuts long calls, its own idle timeout is shorter than 5 seconds or it buffers SSE.
Billing
Usage bills to the Anthropic credentials in the server config, not to the chat user's account. That's the point (non-technical users, no keys), but size the workspace limits accordingly. An agent-level session budget is the other lever.
Deliberately not exposed
| Endpoint | Why not |
agents.archive | Permanent, no undo. One bad tool call bricks a prod agent |
agents.create / update | Authoring belongs in the ant CLI or the Console, not a chat turn |
sessions.list | Would enumerate every session in the workspace. Add it only with the allowlist filter listAgents uses |
sessions.delete, environments.* | Destructive infra ops |
vaults.*, credentials.* | Secrets |
sessions.resources.add | Needs tokens or file IDs the chat user won't have |
Adding one is a function in src/managed-agents.ts plus a registration in src/tools.ts with its scope.
Debugging
| Symptom | Check |
Desktop shows no managed-agents tools | Config path wrong, or bun not on PATH for the Desktop process (use an absolute path to bun). Check Desktop's MCP logs. |
CLAUDE_ENVIRONMENT_ID is required | Env block missing from the Desktop config. stdio servers don't read your shell's env. With Claude Code, check the --env-file path. |
ALLOWED_AGENT_IDS has an entry that is not an agent ID | A typo or a stray space-separated value. The list is comma-separated agent_… IDs, and the server stops on a bad one so a typo can't pass for a working allowlist. |
| A tool answers "not available through this server" | The agent, or the session's agent, is not in ALLOWED_AGENT_IDS. The message is the same if the ID doesn't exist. |
wait_for_idle returns empty reply | The agent went idle without emitting text (for example only tool calls), or status is not "idle". list_events shows the full log. |
| Every turn starts a new session | Claude isn't threading session_id. Tighten the Project instructions. |
FATAL: MANAGED_AGENTS_MCP_TOKEN must be set | Not in .env, or shorter than 32 characters. bun run http loads .env from this directory. |
FATAL: HOST=… is not loopback, so ALLOWED_HOSTS is required | You set HOST=0.0.0.0 (the Docker image does). Name the public hostname in ALLOWED_HOSTS. |
| HTTP 421 | The Host header isn't in ALLOWED_HOSTS. Add the tunnel or deploy hostname, with the port if the client sends one. |
| HTTP 403 | The request carried an Origin header that isn't in ALLOWED_ORIGINS. A browser is calling, not an MCP client. |
| HTTP 401, or the connector shows "couldn't connect" | URL wrong, server not reachable, or token mismatch. |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

