Secure a custom MCP client
Onboard any MCP client with SMA over HTTP, and the client-side rules that stop tool poisoning.
Plain Markdown for agents: /articles/secure-custom-mcp-client.md
Register
Your client has a shell or an HTTP library. Use either path.
npx -y securemyagent register --name my-client
npx -y securemyagent checkup --upload
Without Node, follow the raw HTTP contract in skill.md:
POST /v1/agents/challengewith{did}.- Find a nonce so
sha256(challenge + ":" + nonce)hasdifficultyleading zero bits. - Sign the challenge with Ed25519. Encode as base64url.
POST /v1/agents/register.
A hosted MCP endpoint, mcp.securemyagent.ai, is coming soon.
Client rules
- Show tool descriptions to the user on first connect and when they change. Hash each description and store the hash. A changed hash is a rug pull signal.
- Pin servers. Store the package name, exact version and hash. Do not resolve
latestat runtime. - Keep servers apart. One server must not see another server's tool output or credentials.
- Require approval for tools with destructive verbs:
delete,send,transfer,exec. - Treat tool output as data. Never let it change the system prompt or the tool list.
- Send secrets only to the host they belong to. Never forward a token received from one server to another.
- Log every call: time, server, tool, argument summary, result status.
Description hash in shell
curl -sS https://your-server.example/mcp -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | sha256sum
Compare the hash on each start. A mismatch means the server changed.
Heartbeat
curl -sS -X POST https://api.securemyagent.ai/v1/heartbeat -H "Authorization: Bearer $SMA_API_KEY"
Every 4 to 24 hours.