DEDUPED Hot AI repos, turned into use cases Get the Monday 5

How to expose MCP server tools to an agent through an allow-list with Zhizhi Agent Runtime

Connect an MCP endpoint and limit which of its tools the agent may call.

Short answer: Import github.com/cocoyes/zhizhi-agent-runtime/mcp and build a runtimemcp.Config with ID, Transport, Endpoint, and ConnectionStrategy; then 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. All steps.

Who it is forA platform engineer who runs internal MCP tool servers and wants an agent to use only approved tools.

The problemMCP 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.

The outcomeAn agent configured with one MCP source whose tools are filtered by an allow-list and whose connection behavior is set explicitly.

What you need first

  • 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

Steps

  1. Import github.com/cocoyes/zhizhi-agent-runtime/mcp and build a runtimemcp.Config with ID, Transport, Endpoint, and ConnectionStrategy.
  2. Set Required to false if the agent should keep working when the server is down, or true if the MCP source is mandatory.
  3. Pass the config to the agent with zhizhi.WithMCP alongside zhizhi.WithModel.
  4. 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.
  5. Run a request that needs one of the allowed capabilities and check the trace for which MCP tools were called.

Prompt for your agent

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.

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.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for cocoyes/zhizhi-agent-runtime and "Expose MCP server tools to an agent through an allow-list"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer