Connect a client
Any MCP client that takes a URL and headers works with the hosted endpoint. Use a test key.
Set RENKO_API_KEY to a renko_sk_test_... key (see the Quickstart). The tools and their limits are listed on the MCP page. Live trading is not switched on yet, so a test key is the only kind there is.
Claude Code
Hosted endpoint, from the command line:
claude mcp add --transport http renko https://usetomahawk.xyz/api/v2/mcp \
--header "Authorization: Bearer $RENKO_API_KEY"Or .mcp.json in the project (Claude Code expands ${RENKO_API_KEY} from your environment):
{
"mcpServers": {
"renko": {
"type": "http",
"url": "https://usetomahawk.xyz/api/v2/mcp",
"headers": { "Authorization": "Bearer ${RENKO_API_KEY}" }
}
}
}Cursor
~/.cursor/mcp.json or .cursor/mcp.json in the project. Remote entries take url and headers; ${env:NAME} reads an environment variable.
{
"mcpServers": {
"renko": {
"url": "https://usetomahawk.xyz/api/v2/mcp",
"headers": { "Authorization": "Bearer ${env:RENKO_API_KEY}" }
}
}
}Claude Desktop
claude_desktop_config.json (Windows: %APPDATA%\Claude\, macOS: ~/Library/Application Support/Claude/) launches local commands, so it runs the stdio server from a checkout of this repository. Build it once, put the absolute path of the repository in place of <repo>, replace the key and restart the app.
pnpm -C <repo>/packages/mcp build{
"mcpServers": {
"renko": {
"command": "node",
"args": ["<repo>/packages/mcp/dist/stdio.js"],
"env": { "RENKO_API_KEY": "renko_sk_test_REPLACE_ME" }
}
}
}Function calling (no MCP)
GET /api/v2/agent/tools is public and lists every tool with a JSON Schema. Map it to your provider's tool format and run the model's calls through the hosted MCP endpoint, which enforces your key's limits. This part is plain JavaScript for Node 20 or later.
const BASE = "https://usetomahawk.xyz/api/v2";
const res = await fetch(`${BASE}/agent/tools`); // public: the same list the MCP endpoint serves
const { data: tools } = await res.json();
// run the tool the model chose: the hosted MCP endpoint executes it under your key's limits
async function callTool(name, args) {
const r = await fetch(`${BASE}/mcp`, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.RENKO_API_KEY}`, "content-type": "application/json" },
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "tools/call", params: { name, arguments: args } }),
});
return (await r.json()).result; // { content: [{ type: "text", text }], isError? }
}// tools as the Anthropic API wants them
const anthropicTools = tools.map((t) => ({ name: t.name, description: t.description, input_schema: t.inputSchema }));
// for each tool_use block in the reply: await callTool(block.name, block.input)// tools as the OpenAI API wants them
const openaiTools = tools.map((t) => ({ type: "function", function: { name: t.name, description: t.description, parameters: t.inputSchema } }));
// for each tool call in the reply: await callTool(call.function.name, JSON.parse(call.function.arguments))Authorization header or the stdio command above. Their config formats are not documented here.