スマレジMCPサーバー
Enables LLMs to generate code for interacting with the Smaregi platform API by providing API usage documentation, but does not call the actual API.
README
社内勉強会の発表資料用のMCPサーバ試作レポジトリです。
スマレジMCPサーバー
スマレジプラットフォームAPIの操作方法を提供するModel Context Protocol (MCP) サーバーです。
概要
このMCPサーバーは、LLM(Claude、GPT等)がスマレジAPIを使用するコードを生成できるよう、API操作方法の情報を提供します。実際のAPIを呼び出すのではなく、APIの使用方法を教えるドキュメントサーバーとして機能します。
機能
提供するリソース
-
取引一覧取得方法 (
smaregi://api/transactions/list)- スマレジAPIから取引一覧を取得する方法
- エンドポイント、パラメータ、サンプルコードを含む
-
取引作成方法 (
smaregi://api/transactions/create)- スマレジAPIで新規取引を作成する方法
- 必須フィールド、リクエスト形式、サンプルコードを含む
特徴
- 動的ドキュメント取得: 最新のスマレジAPIドキュメントを都度取得
- MCP準拠: 標準的なMCPプロトコルに完全準拠
- Docker対応: コンテナとして簡単にデプロイ可能
- STDIO Transport: 標準入出力による安全な通信
必要な環境
- Docker(推奨)
- または Rust 1.75以上(直接実行する場合)
インストールと使用方法
Dockerを使用する場合(推奨)
-
MCPクライアント設定
MCPクライアント(Claude Desktop等)の設定ファイルに以下を追加:
{ "mcpServers": { "smaregi": { "command": "docker", "args": ["run", "--rm", "-i", "smaregi-mcp:latest"] } } } -
使用例
MCPクライアントで以下のように質問できます:
スマレジAPIで取引一覧を取得するコードを書いてスマレジAPIで新しい取引を作成するPythonコードを教えて
直接実行する場合
-
ビルド
cargo build --release -
実行
./target/release/smaregi-mcp
開発者向け情報
プロジェクト構造
.kiro/specs/: プロジェクト仕様(要件、設計、タスク)docs/: 技術ドキュメントsrc/: Rustソースコード(実装後)
開発に参加する
MCP Inspectorによる動作確認
開発中のMCPサーバーの動作確認には、公式のMCP Inspectorを使用します。
インストール
npm install -g @modelcontextprotocol/inspector
基本的な使い方
# 開発中(デバッグビルド)
mcp-inspector cargo run
# リリースビルド
cargo build --release
mcp-inspector ./target/release/smaregi-mcp
# Docker環境
docker build -t smaregi-mcp:latest .
mcp-inspector docker run -i smaregi-mcp:latest
確認項目
- サーバーが正常に起動するか
- リソース一覧が正しく表示されるか(Resources Tab)
- 各リソースの内容が取得できるか
- エラーハンドリングが適切か
- ログ出力が正しく動作するか
注意事項
- Inspectorの後にコマンド全体をそのまま渡す(
--は不要) - STDIO方式のサーバーでは標準出力に書き込まない(JSON-RPCが破壊される)
- ログはstderrに出力する
技術仕様
- 言語: Rust
- MCPプロトコル: JSON-RPC 2.0 over STDIO
- アーキテクチャ: 4層構造(Transport → Protocol → Resource → Application)
- ドキュメントソース: https://developers.smaregi.dev/platform-api-reference/
制限事項
- 実際のスマレジAPIは呼び出しません
- 認証機能は提供しません
- データの保存やキャッシュは行いません
- 取引一覧取得と作成のみをサポート(PoC範囲)
ライセンス
このプロジェクトはProof of Conceptとして作成されています。
参考資料
サポート
技術的な質問や問題については、プロジェクトの仕様ドキュメントを参照してください。
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.