How to Connect an MCP Server to Your AI Agent (Without Leaking API Keys)
Blog post from Orkes
Model Context Protocol integrations often require API keys to be available in the agent process, creating risks because keys can spread across worker environments, logs, retries, and scaled deployments. The post describes using Agentspan to separate tool-selection logic from credential handling by compiling agent definitions into server-side executions, where MCP discovery and tool calls occur and secrets remain stored in the server’s credential store. Its `mcp_tool()` primitive discovers an MCP server’s available tools and exposes them to an agent, while credential placeholders allow code to reference a secret by name without containing its value. A weather-service example demonstrates that the Agentspan server injects the bearer token only when making the authenticated request, and deleting the stored credential produces an unauthorized response without changing the agent code. The approach also supports limiting an agent to selected MCP tools, while server-side execution records tool arguments, results, timing, and execution history and can continue running even if the initiating client process stops.
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.