MCP.so
ログイン

MCP C

@ZenWayne

基本情報

カテゴリ

その他

ライセンス

MIT license

トランスポート

stdio

作者

ZenWayne

MCP C について

mcp server frarmwork written in c, developing efficiently and effortlessly

MCP C の設定

標準の設定はありません

このサーバーの README には解析可能な MCP 設定ブロックが含まれていません。インストール手順はリポジトリをご確認ください。

リポジトリ

MCP C のツール

ツール一覧はまだありません

この掲載には表示できるツール一覧がまだありません。サーバーにツールがないという意味ではありません。対応機能はプロジェクトのドキュメントをご確認ください。

ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。

概要

What is mcp-c?

mcp-c is a framework written in C for building Model Context Protocol (MCP) servers efficiently. It uses annotation-based code generation to automate boilerplate, letting developers focus only on writing the server functions.

How to use mcp-c?

Write your MCP tools in src/mcp_server using the EXPORT and EXPORT_AS macros on functions and structs. Build with cmake -B build -S . && cmake --build ., then run the generated binary with ./mcpc (Windows users need vcpkg). The build process runs a code generator that creates serialization code and tool lists automatically.

Key features of mcp-c

  • Annotate C structs to auto‑generate JSON schema definitions.
  • Export function names as tool handlers via EXPORT_AS macro.
  • Automatic serialization between JSON and C structs.
  • Built‑in bridge code generation for tool input/output parsing.
  • Supports enums, nested structs, and descriptions with DES macro.

Use cases of mcp-c

  • Rapidly prototyping an MCP server in C with minimal manual coding.
  • Automatically generating JSON schemas for complex nested data types.
  • Creating custom MCP tools without writing repetitive glue code.
  • Integrating MCP capabilities into existing C‑based projects.

よくある質問

1

What macros are available in mcp-c?

`EXPORT` marks a struct or function for export; `EXPORT_AS(name)` gives it a custom name for tool mapping; `DES("description")` adds JSON schema descriptions.

2

How do I define a tool in mcp-c?

Write a C function that returns `cJSON*` and annotate it with `EXPORT_AS(tool_name)`. The tool name can be anything, including `tools/list` for the standard MCP list endpoint.

3

What files does the code generator produce?

It generates `generated_bridge_code.c` (JSON‑to‑struct parsing) and `generated_function_signatures.c` (struct definitions and the `get_all_function_signatures_json` function).

4

What are the prerequisites to build mcp-c?

You need cmake, clang, and [cJSON](https://github.com/DaveGamble/cJSON). On Windows, vcpkg is also required.

5

How is the generated JSON schema structured?

It follows a `$defs`-based JSON Schema draft‑07 format, with separate definitions for enums, objects, and their properties, plus a `tools` array listing each exported tool and its input schema.

コメント

「その他」の他のコンテンツ