bookstore-mcp-server
Provides tools for managing bookstore data, such as fetching books, using Firebase Firestore as the database.
Click on "Install 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., "@bookstore-mcp-servershow me best-selling fantasy books"
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.
Simple MCP Server for an Online Bookstore with Custom AI Agent - POC
ποΈ Overview
This project is a proof-of-concept implementation of a Model Context Protocol (MCP) server and a custom AI-powered bookstore agent. It demonstrates how an LLM can call structured tools exposed by an MCP server (e.g., search books) and how a separate agent process can communicate with that server to provide conversational responses.
The repo contains:
An MCP server
Built using
@modelcontextprotocol/sdkExposes a sample of bookstore-related tools (e.g., fetching books)
Includes a seeding script to populate mock bookstore data
A custom bookstore AI Agent
Connects to the MCP server as a client via a dedicated MCP client service:
Uses
@modelcontextprotocol/sdkwith an STDIO-based process transport to talk to the MCP server.Discovers available MCP tools at runtime and invokes them dynamically
Uses OpenAI to answer user queries
Decides when to call MCP tools to fetch inventory data
Can respond normally or stream responses token-by-token
A lightweight Express API provides endpoints for:
non-streaming LLM answers
streaming LLM answers (chunked over HTTP)
Demonstrates how a backend service can expose the agent to external clients
Related MCP server: Model Context Protocol (MCP) Server
π οΈ Tech Stack
Model Context Protocol (MCP) β structured tool calling using
@modelcontextprotocol/sdkOpenAI API β LLM responses + streaming output
Express 5 β simple HTTP layer
TypeScript β typed agent + server
Zod β schema validation
Firebase Firestore - for bookstore database
GitHub Branches
mainβ Production branch. This branch represents the stable and production-ready version of the code. It is used for deployments to the live environment.devβ Development branch. This is the default branch for ongoing development work. It is where new features and bug fixes are implemented and tested before being merged into the main branch. It is used for deployments to the staging environment.
Development
Scripts
npm run dev:serverβ Run the MCP server in development mode with hot-reloadingnpm run dev:agentβ Run the Bookstore Agent in development mode with hot-reloadingnpm run buildβ Compile the TypeScript code to JavaScriptnpm run start:serverβ Start the MCP server in production modenpm run start:agentβ Start the Bookstore Agent in production modenpm run seed:bookstoreβ Seed the Firestore database with mock bookstore data
Testing the MCP server locally using Claude Client
Download Claud Desktop
Locate the config file
From Claud App -> Settings > Developer -> Edit config
The path is probably:
code "$HOME/Library/Application Support/Claude/claude_desktop_config.json"Prepare the config file
# check the absolute path to the server
β― pwdEnsure Claude will run the correct version of Node:
which node
# should output smt like
> /Users/mistergreen/.nvm/versions/node/v22.17.0/bin/nodeUse this path as command in the server config below (instead of using simply node)
Option A β Use the built JS file
If you run npm run build and want Claude to call the compiled JS:
{
"mcpServers": {
"demo-server": {
"command": "/Users/mistergreen/.nvm/versions/node/v22.17.0/bin/node",
"args": ["<ABSOLUTE-PATH>/dist/mcp-server/index.js"],
"env": {
"LOG_LEVEL": "info"
}
}
}
}Option B β Run TypeScript directly (good for dev)
If you donβt want to build every time, Claude can launch your server through tsx:
{
"mcpServers": {
"demo-server": {
"command": "/Users/mistergreen/.nvm/versions/node/v22.17.0/bin/node",
"args": ["<ABSOLUTE-PATH>/node_modules/tsx/dist/cli.js", "<ABSOLUTE-PATH>/src/mcp-server/index.ts"],
"env": {
"LOG_LEVEL": "info"
}
}
}
}Test
Save the config.json.
Quit and restart Claude Desktop.
Testing tools: Start a new chat and try:
Use the add tool with a=2 and b=3
Claud should discover the add tool.
Debug
From Claud App -> Settings > Developer -> Logs
Testing the agent API
Start the MCP server
npm run dev:serverStart the agent API
npm run dev:agentSend requests to the agent API
E.g. using curl:
curl -X POST http://localhost:5000/ask \
-H "Content-Type: application/json" \
-d '{"question": "Can you recommend me a sci-fi book?"}'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.
Latest Blog Posts
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/aga87/mcp-server-and-ai-agent-bookstore'
If you have feedback or need assistance with the MCP directory API, please join our Discord server