Guides›Publishing ZK MCP
Publishing a Zero-Knowledge MCP
If you have built a Model Context Protocol (MCP) server that connects to a sensitive API, you should publish it as a Zero-Knowledge server so your users don't have to paste API keys into their IDE configs.
1Remove your config schema
Your MCP server should not define environment variables or arguments for credentials in its configuration block.
Instead, document which key names the user should set in their AgentSecrets CLI.
2Use the AgentSecrets SDK
In your Python MCP server, initialize the AgentSecrets client:
from agentsecrets import AgentSecrets client = AgentSecrets()
Instead of using httpx or requests manually with os.getenv, route your requests through the client:
response = await client.async_call( "https://api.your-service.com/data", bearer="YOUR_SERVICE_KEY" )
3Document the Setup
In your repository's README, instruct users to:
- Install
agentsecrets - Run
agentsecrets secrets set YOUR_SERVICE_KEY=value - Add your domain to the allowlist:
agentsecrets workspace allowlist add api.your-service.com - Configure Claude/Cursor to run your script directly, without an
envblock.
Was this helpful?
Thanks for your feedback!
Your feedback helps us improve the platform.