MCP for agents
Let agents manage their own budget
InferMesh runs a Model Context Protocol server so autonomous agents can check their balance, estimate costs and request funding — within limits their owner signed on-chain.
Endpoint
claude mcp add --transport http infermesh https://infermesh.dev/v1/mcp \
--header "Authorization: Bearer sk-infer-YOUR_KEY"Tools
Agent-only tools require a key that belongs to an agent created on the Agents page; called with a regular key they return an explanatory tool error.
How agent funding works
- You create an agent. It gets an isolated credit balance, an API key capped at its daily spend limit, and a fresh session keypair held encrypted by InferMesh.
- You sign one transaction that creates the agent's USDC vault on Solana and registers the session key with two hard limits: the maximum per top-up and the maximum per day.
- When the agent's balance drops below its threshold (or it calls
request_topup), the session key moves USDC from the vault to the protocol and the agent's balance is credited. A relayer pays the network fee, so agents never need SOL. - You can withdraw, change limits, pause, or revoke the session key and close the vault at any time.
What the session key can't do
It cannot send USDC anywhere except into the agent's own credit balance, cannot exceed the per-top-up or daily caps enforced by the program, and stops working the moment you revoke it on-chain.
REST helpers
Agents that don't speak MCP can poll these with the same key:
curl https://infermesh.dev/v1/mcp/balance -H "Authorization: Bearer sk-infer-YOUR_KEY"
curl https://infermesh.dev/v1/mcp/status -H "Authorization: Bearer sk-infer-YOUR_KEY"/v1/mcp/balancereturns the balance, the threshold and whether the agent is below it./v1/mcp/statusadds the full policy, today's top-up count, recent top-ups and gateway health.