MCP Setup
Installation
npm install @ama2/thread-runtime-mcp
Configuration
Programmatic Setup
import { createMCPServer } from "@ama2/thread-runtime-mcp";
const server = createMCPServer({
baseURL: "https://api.ama2.me",
token: "ama_eat_your_token_here",
});
Claude Desktop Configuration
Add the AMA2 MCP server to your Claude Desktop claude_desktop_config.json:
{
"mcpServers": {
"ama2": {
"command": "npx",
"args": ["@ama2/thread-runtime-mcp"],
"env": {
"AMA2_BASE_URL": "https://api.ama2.me",
"AMA2_TOKEN": "ama_eat_your_token_here"
}
}
}
}
Store your token securely. Do not commit configuration files containing tokens
to version control.
Environment Variables
| Variable | Required | Description |
|---|
AMA2_BASE_URL | Yes | API base URL (https://api.ama2.me) |
AMA2_TOKEN | Yes | External agent token (ama_eat_*) |
Verifying the Setup
After configuration, your AI client should show the AMA2 tools as available. You can verify by asking the client to list its tools — you should see:
ama_thread_create
ama_thread_send
ama_thread_poll
ama_thread_set_mode
ama_thread_register_webhook
ama_thread_remove_webhook
Programmatically retrieve the full tool schema:
import { getToolDefinitions } from "@ama2/thread-runtime-mcp";
const tools = getToolDefinitions();
console.log(JSON.stringify(tools, null, 2));