mcp-server-claude-chat
MCP server enabling Claude chat, image analysis, live web search, and model listing through Anthropic's Messages API. Allows any MCP client to consult Claude as a tool via stdio JSON-RPC.
README
mcp-server-claude-chat
An MCP (Model Context Protocol) server for the Anthropic Claude Messages API. Built in Rust, it exposes chat, vision, live web search, and model listing as MCP tools — so any MCP client (Claude Desktop, Claude Code, etc.) can consult Claude as a tool.
Communicates via stdio using JSON-RPC 2.0, like all the other MCP servers in this collection. Structurally it mirrors mcp-server-grok-chat / mcp-server-gpt-chat, adapted to Anthropic's API shape.
Subscription vs. API credits
This server uses the Anthropic API with an API key (API credits). That is the only supported, terms-compliant way to drive Claude from a third-party tool.
A Claude Pro/Max subscription (the kind that powers Claude Code and the Claude apps) is not usable here: that authentication is licensed for Anthropic's own first-party clients, and routing it through a custom server would violate Anthropic's Consumer Terms — the "$200 of Claude usage from another service" concern you raised. So: API key it is. (If you run an Anthropic-compatible gateway, point base_url at it — see Configuration.)
Tools
| Tool | Description |
|---|---|
chat |
Send a message to Claude. Supports multi-turn history, a system prompt, model selection, and extended thinking via thinking_budget. |
chat_with_vision |
Analyse an image given an image URL and a text prompt. |
chat_with_search |
Chat with live web search — Claude searches server-side and answers with cited sources. |
list_models |
List available Claude models and their IDs (cached for 5 minutes). |
Note: Anthropic has no embeddings endpoint (they recommend Voyage AI), so unlike the grok/gpt servers there is no
embeddingtool.
chat
| Name | Type | Required | Description |
|---|---|---|---|
prompt |
string | yes | The user message to send |
system_prompt |
string | no | System prompt to set context/behaviour |
messages |
string | no | Conversation history as a JSON array of {role, content} objects (roles: user/assistant only — use system_prompt for system instructions) |
model |
string | no | Model ID (default: server default, claude-opus-4-8). Call list_models. |
temperature |
float | no | Sampling temperature (0.0–1.0). Ignored when thinking_budget is set. |
max_tokens |
integer | no | Max tokens to generate (defaults to the server default) |
thinking_budget |
integer | no | Enable extended thinking with this token budget (min 1024). Reasoning is returned in a [thinking] block; max_tokens is auto-raised above the budget. |
chat_with_vision
| Name | Type | Required | Description |
|---|---|---|---|
prompt |
string | yes | Text prompt describing what to analyse |
image_url |
string | yes | URL of the image (must be http:// or https://) |
model |
string | no | Vision-capable model ID (default: server default) |
temperature |
float | no | Sampling temperature (0.0–1.0) |
max_tokens |
integer | no | Max tokens to generate |
chat_with_search
| Name | Type | Required | Description |
|---|---|---|---|
prompt |
string | yes | The user message |
system_prompt |
string | no | System prompt |
model |
string | no | Model ID (default: server default) |
temperature |
float | no | Sampling temperature (0.0–1.0) |
max_tokens |
integer | no | Max tokens to generate |
max_uses |
integer | no | Max web searches Claude may run for this request (default: 5) |
Web search is billed by Anthropic at $10 per 1,000 searches on top of token costs, and an org admin must enable web search in the Claude Console.
list_models
No parameters. Results cached for 5 minutes.
Prerequisites
- Rust (edition 2024)
- An Anthropic API key from console.anthropic.com
Setup
mkdir -p ~/.config/mcp-server-claude-chat
cp config.toml.example ~/.config/mcp-server-claude-chat/config.toml
# then edit it and set api_key
Config (~/.config/mcp-server-claude-chat/config.toml):
api_key = "sk-ant-..."
# Optional:
# base_url = "https://api.anthropic.com/v1" # or a compatible gateway
# default_model = "claude-opus-4-8"
# default_max_tokens = 4096
The server fails fast at startup if the config is missing or api_key is empty.
Build
cargo build --release # produces target/release/claude-chat
cargo build # debug build
cargo run # run in dev mode
RUST_LOG=debug cargo run
cargo test # unit tests (response formatting, validation, message building)
MCP Configuration
Claude Desktop (~/.config/Claude/claude_desktop_config.json) or any MCP client:
{
"mcpServers": {
"claude-chat": {
"command": "/media/codechap/4TB/develop/mcps/mcp-server-claude-chat/target/release/claude-chat"
}
}
}
Claude Code:
claude mcp add claude-chat -- /media/codechap/4TB/develop/mcps/mcp-server-claude-chat/target/release/claude-chat
Project Structure
src/
main.rs - entry point, config loading, stdio transport setup
server.rs - MCP tool definitions (chat, chat_with_vision, chat_with_search, list_models)
api.rs - Anthropic HTTP client, Messages/Models types, response formatter
params.rs - tool parameter types with serde + JSON Schema derives
config.rs - TOML config loading
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。