mcpField
C
crimson-crab-mcp-template

crimson-crab-mcp-template

Local
github.com/singhpratechDeveloper Tools0Updated 12w ago

About crimson-crab-mcp-template

crimson-crab-mcp-template is a Rust starter template for developers building MCP servers that use Anthropic's Claude API through the crimson-crab SDK. It includes tools for prompts, multi-turn chat, token counts, and model information.

Key features

  1. 01Single-prompt Claude requests
  2. 02Multi-turn conversation support
  3. 03Model-specific token counting
  4. 04List available Claude models
  5. 05Retrieve model limits and metadata

Use cases

  1. 01Starting a Claude-powered MCP server in Rust
  2. 02Sending prompts and maintaining conversation history
  3. 03Estimating input tokens before an API call
  4. 04Checking models available to an API key

MCP support

The server communicates with MCP clients over stdio and exposes five tools for Claude requests, chat, token counting, and model information.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

Claude-powered MCP server in Rust (starter template)

crimson-crab-mcp-template MCP server crates.io license

A minimal, production-ready Model Context Protocol (MCP) server, written in Rust, backed by Anthropic's Claude API through the crimson-crab SDK. It exposes five tools: ask_claude (send a prompt, get Claude's reply), chat (multi-turn conversation), count_tokens (price a prompt without running it), list_models (enumerate the models your API key can use), and get_model (limits and metadata for one model).

Use it as the reference starting point for building your own Claude-powered MCP tools in Rust.

Use this template

Click Use this template on GitHub, or generate a fresh project with cargo generate:

cargo generate --git https://github.com/singhpratech/crimson-crab-mcp-template

You can also just clone it:

git clone https://github.com/singhpratech/crimson-crab-mcp-template

Quickstart

export ANTHROPIC_API_KEY=sk-ant-...
cargo run

The server communicates over stdio, so running it directly just waits for an MCP client to connect. All logging goes to stderr — stdout is reserved for the MCP protocol. Set RUST_LOG=debug for more verbose logs.

To build an optimized binary you can point a client at:

cargo build --release
# -> target/release/crimson-crab-mcp-template

Wire it into Claude Desktop

Add an entry to your Claude Desktop MCP config (claude_desktop_config.json), pointing at the built binary and passing your API key through the environment:

{
  "mcpServers": {
    "claude-via-crimson-crab": {
      "command": "/absolute/path/to/target/release/crimson-crab-mcp-template",
      "env": {
        "ANTHROPIC_API_KEY": "sk-ant-..."
      }
    }
  }
}

Restart Claude Desktop; the ask_claude, chat, count_tokens, list_models, and get_model tools will then be available.

The tools

ask_claude
ParameterTypeRequiredDescription
promptstringyesThe prompt to send to Claude.
systemstringnoOptional system prompt.

Builds a Claude Messages request (defaulting to the claude-opus-5 model), calls the API, and returns the concatenated text of Claude's reply.

chat
ParameterTypeRequiredDescription
messagesarrayyesThe conversation so far, oldest first: {role, content} where role is an enum constrained to "user" or "assistant". Must end with a user turn.
systemstringnoOptional system prompt.
modelstringnoModel id (defaults to the ask_claude model).
max_tokensintegernoMaximum tokens to generate (default 1024).

Sends the whole message history to Claude and returns the next reply — use it instead of ask_claude when the caller needs to keep context across turns.

count_tokens
ParameterTypeRequiredDescription
promptstringyesThe prompt whose token count you want.
systemstringnoOptional system prompt to include in the count.
modelstringnoModel id to count against (counts are model-specific).

Returns the number of input tokens the prompt would consume, without running it — useful for estimating cost before an expensive call.

list_models
ParameterTypeRequiredDescription
limitintegernoMaximum number of models to return.

Returns the id, display name, and release date of each Claude model available to the configured API key.

get_model
ParameterTypeRequiredDescription
modelstringyesThe model id to look up, e.g. claude-opus-5.

Returns the model's display name, release date, context window (max_input_tokens), and maximum output tokens.

Errors from all tools are returned as MCP tool errors rather than panicking. The Claude client is built once at startup and reused across calls.

Built with crimson-crab

This template is built with crimson-crab — a production-grade Rust SDK for Anthropic's Claude API. Source: https://github.com/singhpratech/crimson-crab.

License

Licensed under either of

at your option.


crimson-crab is an independent open-source project and is not affiliated with Anthropic.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.