loading…
Search for a command to run...
loading…
Enables querying a curated book database using MCP tools to retrieve basic or detailed book information by ISBN or title, including batch lookups.
Enables querying a curated book database using MCP tools to retrieve basic or detailed book information by ISBN or title, including batch lookups.
[!NOTE] This is a small MCP (Model Context Protocol) demo server used during the GitHub Copilot Agents and MCP training sessions. It used by a demo explained in the copilot-agent-and-mcp repository.
Book Database MCP Server exposes a simple set of tools that let an MCP-capable agent or client query a curated book database. Key features:
src/).@modelcontextprotocol/sdk.StdioServerTransport) — this server communicates over stdio.zod for each tool.src/data/books.json (basic list) and src/data/books-details.json (summaries and dates).src/index.ts:get-book-by-isbn — takes isbn: string (10 chars)get-book-by-title — takes title: stringget-books-by-titles — takes titles: string[]get-books-by-isbn-list — takes isbnList: string[] (10-char items)Prerequisites: Node.js (18+ recommended) and npm.
git clone <repo-url>
cd <repo-root>
npm install
npm run build
The build produces build/index.js and the build folder is listed in package.json files.
Start the MCP server (it runs on stdio and writes a startup log to stderr):
node build/index.js
When running successfully you should see an informational message on stderr similar to:
Book database MCP Server running on stdio
You don't need to start the server manually during the demo as it will be started by the MCP server configuration in the webapp demo repository.
The server exposes the tool names listed above. Example calls (conceptual):
Get details by ISBN:
get-book-by-isbn{ "isbn": "0451524935" } # returns details for "1984"Get basic info by title:
get-book-by-title{ "title": "The Hobbit" }Batch lookup by titles:
get-books-by-titles{ "titles": ["1984", "Brave New World"] }The datasets are small JSON files in src/data/ so you can easily tweak entries during a workshop:
src/data/books.json — array of simple book objects (ISBN, title, author)src/data/books-details.json — object with a books array containing summaries and datesStdioClientTransport from @modelcontextprotocol/sdk and spawn this server as a child process so their stdio streams are connected.Выполни в терминале:
claude mcp add book-database-mcp-server -- npx Query your database in natural language
автор: AnthropicRead-only database access with schema inspection.
автор: modelcontextprotocolInteract with Redis key-value stores.
автор: modelcontextprotocolDatabase interaction and business intelligence capabilities.
автор: modelcontextprotocolНе уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории data