mcp-server-sample
mcp-server-sample — メモを保存・検索する最小の MCP サーバー
メモを保存・検索するだけの、最小の MCP サーバーです。外部システムへは一切繋ぎません。
保存先は同じフォルダの notes.json 1ファイルだけです。
MCP の3つのプリミティブを、1つずつ持たせてあります。
プリミティブ | 誰が決めるか | このサーバーでの中身 |
Tools | モデルが判断する |
|
Resources | AI アプリが取得して渡す |
|
Prompts | ユーザーが明示的に選ぶ |
|
必要なもの
Node.js 24 以上(LTS。
node --versionで確認)git
セットアップ
git clone https://github.com/utakatano/mcp-server-sample.git
cd mcp-server-sample
npm installnpm install が通れば準備完了です。この時点では起動しません。
MCP サーバーは AI アプリが起動するので、自分でターミナルから走らせる必要はありません。
AI アプリに繋ぐ
Claude Code
claude mcp add notes -- node /絶対パス/mcp-server-sample/index.jsclaude mcp list で ✔ Connected と出れば繋がっています。
Claude Desktop
設定 → Developer → 「Edit Config」で claude_desktop_config.json を開き、次を追記します。
{
"mcpServers": {
"notes": {
"command": "node",
"args": ["/絶対パス/mcp-server-sample/index.js"]
}
}
}保存したら Claude Desktop を完全に終了して起動し直します(ウィンドウを閉じるだけでは反映されません)。
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
動作確認
「来週までにネットワーク構成を確認する」とメモして「ネットワーク」を含むメモを探してnotes.json が作られ、中身が増えていくのが確認できます。
保存先を変える
環境変数 NOTES_FILE に絶対パスを渡すと、保存先を変えられます。
{
"mcpServers": {
"notes": {
"command": "node",
"args": ["/絶対パス/mcp-server-sample/index.js"],
"env": { "NOTES_FILE": "/絶対パス/my-notes.json" }
}
}
}繋がらないとき
まずログを見ます。原因はたいていここに出ています。
tail -20 ~/Library/Logs/Claude/mcp-server-notes.log # macOS
# Windows: %APPDATA%\Claude\logs\mcp-server-notes.logServer started and connected successfully のあとにエラーが続いていないかを見てください。
ログに出ているもの | 原因 | 対処 |
|
| リポジトリ直下で |
| AI アプリから |
|
| 依存が入っていない | リポジトリ直下で |
ログが空、または更新されない | 設定が読み込まれていない | JSON の構文(カンマ・括弧)を確認し、Claude Desktop を完全に終了(macOS は ⌘Q)してから起動し直す |
サーバー側か AI アプリ側かの切り分けは、手元で直接叩くのが速いです。
printf '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}\n' \
| node /絶対パス/mcp-server-sample/index.jsadd_note と search_notes を含む JSON が返ればサーバーは正常です。その場合は AI アプリ側の設定(パス・JSON の書き方・再起動)を疑ってください。
サプライチェーン対策
npm パッケージの乗っ取りを想定した設定を .npmrc に入れてあります。npm install / npm ci のたびに効きます。
設定 | 何をするか |
| インストール時に依存パッケージのライフサイクルスクリプト( |
|
|
| 公開から7日を過ぎたバージョンだけをインストールする。npm はこれを |
依存は package.json で完全固定(@modelcontextprotocol/server は 2.0.0、zod は 4.4.3)、
package-lock.json に integrity ハッシュ付きで記録してあります。
lock のとおりに入れたいときは npm install ではなく npm ci を使ってください。
依存を更新するときは、意図して1つずつ上げます。
npm outdated
npm install @modelcontextprotocol/server@2.1.0 # save-exact により完全固定で書かれる
npm ls --all # 増えた依存を目で確認するライセンス
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Search, read, and write your Apple Notes from ChatGPT/Claude via a local Mac agent + MCP relay.
Cross-session, cross-device memory for your agent: remember and recall notes. No key to start.
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/utakatano/mcp-server-sample'
If you have feedback or need assistance with the MCP directory API, please join our Discord server