Skip to main content
Glama
TrueLove27

Bookstore MCP Server

by TrueLove27
README.md
# Bookstore MCP Server

Full-stack **bookstore API** with dual exposure: REST endpoints for web clients and **MCP (Model Context Protocol)** tools for LLM agents. One service layer powers both.

## Highlights

- REST API for inventory, orders, and members
- Six MCP tools (`search_books`, `get_book`, `check_stock`, etc.)
- React admin UI with Tool Explorer to invoke MCP tools over HTTP
- Shared service/repository layer — no duplicated business logic

## Stack

| Layer | Tech |
|-------|------|
| Backend | Node.js, Express, MCP SDK, Zod |
| Frontend | React, TypeScript, Vite |
| Data | Local JSON catalog |

## Getting started

```bash
npm run install:all
npm run dev:backend    # http://localhost:8003
npm run dev:frontend   # http://localhost:5176
```

**Docker**

```bash
docker compose up --build
```

- App: http://localhost:8081  
- API: http://localhost:8003/api/v1  
- MCP: http://localhost:8003/mcp  

## MCP tools

| Tool | Purpose |
|------|---------|
| `search_books` | Search by title, author, genre |
| `get_book` | Book details by ID |
| `check_stock` | Availability check |
| `get_order` | Order lookup |
| `get_member` | Member profile |
| `recommend_books` | Genre-based recommendations |

## Example

```bash
curl -X POST http://localhost:8003/api/v1/tools/call \
  -H "Content-Type: application/json" \
  -d '{"tool":"search_books","arguments":{"query":"design"}}'
```

## License

MIT