Claude Chat

io.github.codeChap由 GitHub 账号 codeChap 发布v0.1.0更新于 Oct 24, 2026

Anthropic Claude Messages API MCP server — chat, vision, web search, extended thinking

发布方自己的服务:Claude Platform Docs

概览

AI 生成的概览

本地 MCP 服务器,让助手调用 Anthropic Claude Messages API,实现对话、图像分析、实时网页搜索和模型列表查询。

可以做什么
  • 向 Claude 发送提示,支持多轮历史、系统提示、模型选择以及可选的扩展思考
  • 结合文本提示分析 http 或 https 图片链接中的图像
  • 进行带 Claude 服务端网页搜索的对话,返回带引用的来源,并可限制单次请求的搜索次数
  • 列出可用的 Claude 模型 ID,结果缓存五分钟
适用场景
适合希望在 Claude Desktop、Claude Code 等其他 MCP 客户端中把 Claude 当作工具调用的场景,例如需要额外推理、图像分析或基于实时网页搜索的回答。
运行要求
以本地 stdio 进程运行,需用 Rust 构建(cargo build --release)。需在 ~/.config/mcp-server-claude-chat/config.toml 配置 Anthropic API 密钥,缺失或为空时服务器启动即失败。可选 base_url 指向兼容网关。需要访问 Anthropic API 的网络。
安装前请注意
API 密钥以明文保存在配置文件中,且必须是 API 额度密钥;Claude Pro/Max 订阅无法使用,将其接入本服务器会违反 Anthropic 条款。按 token 计费,网页搜索另按每 1000 次 10 美元计费,并需组织管理员在 Claude Console 中启用。提示、对话历史和图片链接会发送给 Anthropic。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Claude Chat,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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

ToolDescription
chatSend a message to Claude. Supports multi-turn history, a system prompt, model selection, and extended thinking via thinking_budget.
chat_with_visionAnalyse an image given an image URL and a text prompt.
chat_with_searchChat with live web search — Claude searches server-side and answers with cited sources.
list_modelsList 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 embedding tool.

chat

NameTypeRequiredDescription
promptstringyesThe user message to send
system_promptstringnoSystem prompt to set context/behaviour
messagesstringnoConversation history as a JSON array of {role, content} objects (roles: user/assistant only — use system_prompt for system instructions)
modelstringnoModel ID (default: server default, claude-opus-4-8). Call list_models.
temperaturefloatnoSampling temperature (0.0–1.0). Ignored when thinking_budget is set.
max_tokensintegernoMax tokens to generate (defaults to the server default)
thinking_budgetintegernoEnable 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

NameTypeRequiredDescription
promptstringyesText prompt describing what to analyse
image_urlstringyesURL of the image (must be http:// or https://)
modelstringnoVision-capable model ID (default: server default)
temperaturefloatnoSampling temperature (0.0–1.0)
max_tokensintegernoMax tokens to generate

chat_with_search

NameTypeRequiredDescription
promptstringyesThe user message
system_promptstringnoSystem prompt
modelstringnoModel ID (default: server default)
temperaturefloatnoSampling temperature (0.0–1.0)
max_tokensintegernoMax tokens to generate
max_usesintegernoMax 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

Setup

bash
mkdir -p ~/.config/mcp-server-claude-chatcp 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):

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

bash
cargo build --release   # produces target/release/claude-chatcargo build             # debug buildcargo run               # run in dev modeRUST_LOG=debug cargo runcargo test              # unit tests (response formatting, validation, message building)

MCP Configuration

Claude Desktop (~/.config/Claude/claude_desktop_config.json) or any MCP client:

json
{  "mcpServers": {    "claude-chat": {      "command": "/media/codechap/4TB/develop/mcps/mcp-server-claude-chat/target/release/claude-chat"    }  }}

Claude Code:

bash
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

来源:README.md,提交 96225ee

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。

其他 Claude 集成