{
 "schema_version": 1,
 "generated": "2026-10-26",
 "id": "cocoyes-zhizhi-agent-runtime--expose-mcp-tools-through-allowlist",
 "repo": "cocoyes/zhizhi-agent-runtime",
 "repo_url": "https://github.com/cocoyes/zhizhi-agent-runtime",
 "repo_slug": "cocoyes-zhizhi-agent-runtime",
 "title": "Expose MCP server tools to an agent through an allow-list",
 "page_title": "How to expose MCP server tools to an agent through an allow-list with Zhizhi Agent Runtime",
 "summary": "Connect an MCP endpoint and limit which of its tools the agent may call.",
 "who": "A platform engineer who runs internal MCP tool servers and wants an agent to use only approved tools.",
 "problem": "MCP servers can expose many tools. You need the agent to see only the subset you trust and to fail safely if the server is unavailable.",
 "outcome": "An agent configured with one MCP source whose tools are filtered by an allow-list and whose connection behavior is set explicitly.",
 "steps": [
  "Import github.com/cocoyes/zhizhi-agent-runtime/mcp and build a runtimemcp.Config with ID, Transport, Endpoint, and ConnectionStrategy.",
  "Set Required to false if the agent should keep working when the server is down, or true if the MCP source is mandatory.",
  "Pass the config to the agent with zhizhi.WithMCP alongside zhizhi.WithModel.",
  "Add an allow-list so only the MCP tools you approved are visible to planning, using the tool filter options described in the runtime docs.",
  "Run a request that needs one of the allowed capabilities and check the trace for which MCP tools were called."
 ],
 "agent_prompt": "Configure github.com/cocoyes/zhizhi-agent-runtime with a runtimemcp.Config for <internal-mcp-endpoint> using streamable HTTP and a lazy connection strategy. Allow only <tool-names> and run one request that needs them. Verify that the JSONL trace shows calls only to allowed tools.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "2 hours",
 "basis": "readme",
 "caveat": "The README snippet for MCP is truncated, so confirm the exact allow-list and retry option names in docs/architecture.md or the mcp package before relying on them.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "go",
 "requirements": [
  "Go 1.25 or newer",
  "An OpenAI-compatible Chat Completions endpoint with a base URL, API key, and model name",
  "A clone of the repo or a Go module that imports github.com/cocoyes/zhizhi-agent-runtime"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/cocoyes-zhizhi-agent-runtime/expose-mcp-tools-through-allowlist/",
 "md": "https://dedupedai.com/use-cases/cocoyes-zhizhi-agent-runtime/expose-mcp-tools-through-allowlist/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/cocoyes-zhizhi-agent-runtime--expose-mcp-tools-through-allowlist.json",
 "api_version": "v1"
}
