Toy MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Toy MCP Server count how many 'a's are in 'banana'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Toy
概要
FastMCPを利用した、単語内の特定文字の出現回数をカウントするツールと、UUIDv7を生成するツールを提供するシンプルなMCPサーバーです。
count_letters ツールは、大文字・小文字を区別せずに文字をカウントします。
Related MCP server: simple-mcp-server
提供ツール
count_letters
機能: 指定された単語 (
word) の中に、指定された文字 (letter) が何回出現するかを返します。入力:
word(文字列): カウント対象の単語。letter(文字列): カウントする文字。
出力:
result(数値): 文字の出現回数。
リクエスト例 (MCPクライアントから送信される想定):
{
"tool_name": "count_letters",
"tool_args": {
"word": "Programming",
"letter": "m"
}
}レスポンス例 (MCPサーバーから返される想定):
{
"result": 2
}generate_uuid7s
機能: 指定された数のUUIDv7を生成します。デフォルトは1つです。
入力:
count(数値, オプション): 生成するUUIDの数。デフォルトは1。1以上の整数である必要があります。
出力:
result(文字列のリスト): 生成されたUUIDv7のリスト。
リクエスト例 (MCPクライアントから送信される想定):
{
"tool_name": "generate_uuid7s",
"tool_args": {
"count": 3
}
}レスポンス例 (MCPサーバーから返される想定):
{
"result": [
"018fa9e7-7d8a-7b9c-8000-000000000001",
"018fa9e7-7d8a-7b9c-8000-000000000002",
"018fa9e7-7d8a-7b9c-8000-000000000003"
]
}セットアップ
前提条件
Python 3.13.1
Make
uv (Pythonパッケージ管理ツール)
手順
仮想環境の作成と依存関係のインストール:
pyproject.tomlにプロジェクトの依存関係が定義されています。以下のコマンドを実行すると、uvが仮想環境を作成(存在しない場合)し、依存関係を同期します。uv sync
使用方法
このMCPサーバー (server.py) は、標準入出力(stdio)を介してMCPクライアントと通信します。
サーバーを起動するには、プロジェクトのルートディレクトリで以下のコマンドを実行します。
uv run python server.pyまたは、仮想環境を有効化 (source .venv/bin/activate) している場合は、以下でも起動できます。
python server.py起動後、MCPクライアントは上記「提供ツール」セクションに記載されたJSON形式でリクエストを標準入力に送信し、結果を標準出力から受け取ります。
Cursor / Windsurf での使用方法
Cursor / Windsurf の設定ファイル (mcp_config.json など) に以下のように追記することで、このMCPサーバーを利用できます。
{
"mcpServers": {
"letter-counter": {
"command": "uv",
"args": [
"--directory",
"<your_project_directory>",
"run",
"server.py"
]
}
}
}注意: args 内の --directory のパスは、この README.md があるディレクトリ (プロジェクトのルートディレクトリ) を指すように、ご自身の環境に合わせて適宜修正してください。
開発コマンド (Makefile)
プロジェクトのルートディレクトリで以下の make コマンドを実行できます。
フォーマットと静的解析、テストの実行:
make testこのコマンドは、Ruffによるコードフォーマットとチェック、Mypyによる型チェック、Pytestによる単体テスト(カバレッジレポート生成を含む)を一括で実行します。
コードフォーマットとチェック:
make formatこのコマンドは、Ruffを使用してコードのフォーマットとチェック(自動修正含む)を実行します。
ディレクトリ構成
.
├── .venv/ # 仮想環境
├── htmlcov/ # カバレッジレポート (pytest実行後に生成)
├── tests/
│ ├── __init__.py
│ ├── test_count_letters.py # count_lettersツールのテスト
│ └── test_generate_uuid7s.py # generate_uuid7sツールのテスト
├── tools/
│ ├── __init__.py
│ ├── count_letters_tool.py # count_lettersツールの実装
│ └── generate_uuid_tool.py # generate_uuid7sツールの実装
├── pyproject.toml # プロジェクト設定と依存関係
├── server.py # メインのサーバーアプリケーション
├── Makefile # 開発用コマンド定義
└── README.mdAvailable Tools
2 toolscount_lettersB
Count the number of times a letter appears in a word
Inputs: word (required), letter (required). Returns: result
generate_uuid7sB
Generates a specified number of UUIDv7 (default is 1).
Inputs: count. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have completely distinct purposes: one counts letter occurrences in a word, while the other generates UUIDv7 identifiers. There is no overlap or ambiguity between these functions, making it easy for an agent to select the correct tool based on the task.
The tool names follow a verb_noun pattern (count_letters, generate_uuid7s), which is consistent. However, the naming is slightly inconsistent in detail: 'count_letters' uses plural 'letters' while 'generate_uuid7s' uses an abbreviated 'uuid7s' instead of a full noun like 'uuids', but this is minor and does not hinder readability.
With only 2 tools, the server feels thin and under-scoped for a general-purpose 'Toy MCP Server'. This limited set may not adequately cover typical toy or utility domains, suggesting it could benefit from additional tools to provide more comprehensive functionality.
Given the server's name implies a toy or utility domain, the tool set is severely incomplete. It lacks basic operations like string manipulation, random generation, or other common utility functions, leaving significant gaps that would limit an agent's ability to handle diverse tasks within this domain.
Related MCP Connectors
Tiny devtools MCP server: slugs, timestamps, case conversion, hashing, base64, UUIDs.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA simple MCP server that provides tools for generating unique IDs in several formats, useful for when you need an LLM to create data containing new IDs.Eclipse Public 2.0
- AlicenseNot gradedqualityDmaintenanceA simple MCP server offering three utility tools: UUID generation, temperature conversion, and text statistics.11MIT
- FlicenseBqualityDmaintenanceA simple MCP server that provides tools for adding numbers, creating text files, and logging entries.31-
- FlicenseNot gradedqualityDmaintenanceA simple MCP server demo providing 5 basic tools for time, calculations, string operations, UUID generation, and tool listing, built with functional programming principles.-