my-mcp-server
My MCP Server(初心者向け)
MCP(Model Context Protocol)サーバーを自作するための内容です。次の機能を備えています:
.envファイルによる独自のAPIキーとURLのモジュールツール例:
echoとcall_my_apiMCP Inspector ですぐにテスト可能
VS Code(GitHub Copilot Chat)ですぐに利用可能
1. 依存関係をインストール
npm installRelated MCP server: mcp-server-demo
2. .env ファイルを作成
.env.example を .env にコピーし、自分のAPIキーとURLを入力してください:
Copy-Item .env.example .env.env の中身:
MY_API_KEY=api-key-asli-kamu
MY_API_BASE_URL=https://api.contohkamu.com
MCP_SERVER_NAME=my-mcp-server⚠️ 絶対に
.envファイルをgitにコミットしないでください。このファイルは.gitignoreによって自動的に無視されます。
3. プロジェクトをビルド
npm run buildこのコマンドは src/ 内のTypeScriptを build/ 内のJavaScriptにコンパイルします。
4. MCP Inspectorでテスト
MCP Inspectorは、他のクライアントを必要とせずにMCPツールを試せるビジュアル(ブラウザ)ツールです。
npm run inspectorこれにより npx @modelcontextprotocol/inspector node build/index.js が実行され、ブラウザでInspectorが開きます。ここでは次の操作ができます:
Tools タブをクリック
ツール
echoまたはcall_my_apiを選択パラメータを入力し、Run Tool をクリックして結果を確認
5. VS Codeですぐに使う
.vscode/mcp.json ファイルが用意されています。コマンドパレットを開き、MCP: List Servers → my-mcp-server を選択 → Start Server と進みます。このサーバーは envFile 経由で .env を自動的に読み込みます。
プロジェクト構成
├── .env # rahasia kamu (tidak di-commit)
├── .env.example # contoh isi .env
├── .vscode/mcp.json # konfigurasi MCP untuk VS Code
├── src/
│ ├── config.ts # loader environment variable
│ ├── apiClient.ts # modul pemanggilan API eksternal (pakai API key & URL)
│ └── index.ts # server MCP utama + daftar tool
├── package.json
└── tsconfig.json新しいツールを追加する
src/index.ts に新しい server.registerTool("nama_tool", { ... }, async (input) => { ... }) ブロックを追加し、npm run build を再実行してください。
トラブルシューティング
「Environment variable ... belum diisi」エラー →
.envが存在し、内容が入力されていることを確認してください。call_my_apiツールが失敗する →MY_API_BASE_URLとMY_API_KEYが正しいか、APIエンドポイントがAuthorization: Bearer <key>ヘッダーに対応しているかを確認してください。Inspector が開かない → 先に
npm run buildを実行していることを確認してください。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Build and run AI workflows, agents, data tables and 1000+ API integrations from any MCP client.
Remote MCP for 1,500+ APIs. Vault-managed credentials; OAuth or API key. Search, load, and execute.
Email inboxes, webhook URLs, mock APIs and 170+ tools for coding agents over one MCP connection.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables users to expose arbitrary HTTP APIs as configurable MCP tools by defining tool specifications in a JSON configuration file.3-
- FlicenseNot gradedqualityDmaintenanceEnables AI clients to connect to example tools, resources, and prompts over MCP, demonstrating integration with IDEs, chatbots, and agent frameworks.-

automate-mcp-serverofficial
AlicenseNot gradedqualityBmaintenanceEnables building and running MCP servers for Umbraco add-ons, with tools for API interactions, OAuth setup, and testing via MCP Inspector or Claude Code.1MIT- AlicenseNot gradedqualityBmaintenanceEnables developers to build, test, debug, and operate MCP servers from VS Code or CI, while also exposing trusted MCP capabilities to AI agents.MIT