API Integration
Integrate this MCP server into your applications.
Get your API Key
You'll need to login and generate a Smithery API key to connect to this server.
Installation
Install the Smithery and MCP SDKs using npm:
npm install @smithery/sdk @modelcontextprotocol/sdk
TypeScript SDK
Use Smithery's TypeScript SDK to connect to this MCP server:
typescript
import { createTransport } from "@smithery/sdk/transport.js"
const transport = createTransport("https://server.smithery.ai/@brendancopley/mcp-chain-of-draft-prompt-tool/ws", {
"LLM_MODEL": "claude-3-7-sonnet-latest",
"COD_DB_URL": "sqlite:///cod_analytics.db",
"LLM_PROVIDER": "anthropic",
"COD_MAX_TOKENS": "500",
"ENFORCE_FORMAT": "true",
"OPENAI_API_KEY": "string",
"COD_EXAMPLES_DB": "cod_examples.db",
"MISTRAL_API_KEY": "string",
"OLLAMA_BASE_URL": "http://localhost:11434",
"OPENAI_BASE_URL": "https://api.openai.com",
"ANTHROPIC_API_KEY": "string",
"COD_DEFAULT_MODEL": "claude-3-7-sonnet-latest",
"ANTHROPIC_BASE_URL": "https://api.anthropic.com",
"ADAPTIVE_WORD_LIMIT": "true",
"COD_MAX_WORDS_PER_STEP": "5"
}, "your-smithery-api-key")
// Create MCP client
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
const client = new Client({
name: "Test client",
version: "1.0.0"
})
await client.connect(transport)
// Use the server tools with your LLM application
const tools = await client.listTools()
console.log(`Available tools: ${tools.map(t => t.name).join(", ")}`)
// Example: Call a tool
// const result = await client.callTool("tool_name", { param1: "value1" })
Configuration Schema
Full JSON Schema for server configuration:
json
{
"type": "object",
"required": [],
"properties": {
"LLM_MODEL": {
"type": "string",
"default": "claude-3-7-sonnet-latest",
"description": "Default model to use (provider-specific)"
},
"COD_DB_URL": {
"type": "string",
"default": "sqlite:///cod_analytics.db",
"description": "URL for Chain of Draft analytics database"
},
"LLM_PROVIDER": {
"type": "string",
"default": "anthropic",
"description": "Choose which provider to use - 'anthropic', 'openai', 'mistral', or 'ollama'"
},
"COD_MAX_TOKENS": {
"type": "string",
"default": "500",
"description": "Maximum tokens for Chain of Draft"
},
"ENFORCE_FORMAT": {
"type": "string",
"default": "true",
"description": "Whether to enforce format in Chain of Draft"
},
"OPENAI_API_KEY": {
"type": "string",
"description": "API key for OpenAI models"
},
"COD_EXAMPLES_DB": {
"type": "string",
"default": "cod_examples.db",
"description": "Path to Chain of Draft examples database"
},
"MISTRAL_API_KEY": {
"type": "string",
"description": "API key for Mistral AI models"
},
"OLLAMA_BASE_URL": {
"type": "string",
"default": "http://localhost:11434",
"description": "Base URL for Ollama local deployment"
},
"OPENAI_BASE_URL": {
"type": "string",
"default": "https://api.openai.com",
"description": "Base URL for OpenAI API"
},
"ANTHROPIC_API_KEY": {
"type": "string",
"description": "API key for Anthropic Claude models"
},
"COD_DEFAULT_MODEL": {
"type": "string",
"default": "claude-3-7-sonnet-latest",
"description": "Default model for Chain of Draft"
},
"ANTHROPIC_BASE_URL": {
"type": "string",
"default": "https://api.anthropic.com",
"description": "Base URL for Anthropic API"
},
"ADAPTIVE_WORD_LIMIT": {
"type": "string",
"default": "true",
"description": "Whether to use adaptive word limit in Chain of Draft"
},
"COD_MAX_WORDS_PER_STEP": {
"type": "string",
"default": "5",
"description": "Maximum words per step in Chain of Draft"
}
},
"description": "Configuration options for the MCP server"
}