Skip to main content
Glama
by csnkarthik
IMPLEMENTATION_SUMMARY.md7.47 kB
# SevenRooms MCP Server - Project Summary ## ✅ Completed Deliverables ### 1. Official MCP SDK Implementation - **Framework:** TypeScript + @modelcontextprotocol/sdk (latest) - **Architecture:** STDIO-based MCP server per official specification - **Code:** `src/index.ts` — main server implementation - **Build:** TypeScript compiled to `build/index.js` ### 2. MCP Tool: make_reservations - **Location:** Registered in `src/index.ts` line 46 - **Description:** Create restaurant reservations with SevenRooms - **Input Validation:** Zod schema with email, required fields - **API Integration:** POST to `{SEVENROOMS_API_URL}/reservations` - **Error Handling:** Returns structured error responses - **Output:** Returns SevenRooms API response (reservation confirmation) ### 3. MCP Resource: available_time_slot - **Location:** Registered in `src/index.ts` line 116 - **URI Template:** `available://{date}/{time}/{party_size}` - **Description:** Query available reservation time slots - **API Integration:** GET to `{SEVENROOMS_API_URL}/availability` - **Filtering:** Returns only times where `type === 'book'` - **Output:** JSON with `available_times` array of strings ### 4. Testing - **Framework:** Mocha + Chai - **Location:** `test/makeReservation.test.js` and `test/availableTimeSlot.test.js` - **Test Run:** `npm test` → 7 tests passing ✅ - **Coverage:** - Build exists and compiles without errors - Tools and resources registered - Environment variables required - Server structure validated ### 5. Azure Deployment - **Workflow:** `.github/workflows/azure-deploy.yml` - **Triggers:** Push to `main` branch - **Steps:** 1. Checkout code 2. Setup Node.js 18 3. Install dependencies (`npm ci`) 4. Run tests (`npm test`) 5. Build TypeScript (`npm run build`) 6. Deploy to Azure App Service (using publish profile secret) - **Secrets Required:** - `AZURE_WEBAPP_NAME` — Azure Web App name - `AZURE_WEBAPP_PUBLISH_PROFILE` — Azure publish profile XML - **App Service Configuration (runtime):** - `SEVENROOMS_API_KEY` — Your SevenRooms API key - `SEVENROOMS_API_URL` — Your SevenRooms API base URL ### 6. Documentation - **README.md** — Complete guide including: - Project structure - Local development setup - Tool/resource usage examples - SevenRooms API endpoints - Azure deployment instructions - Troubleshooting - Logging best practices ### 7. Configuration Files - **package.json** — Fully configured with: - Type: "module" for ES modules - Build, start, test scripts - Dependencies: @modelcontextprotocol/sdk, axios, zod - DevDependencies: TypeScript, @types/node, tsx, mocha, chai - **tsconfig.json** — TypeScript configuration per MCP guide - **.env.example** — Environment variable template - **.gitignore** — (included in root) ## Project Structure ``` sevenroom-mcp-server-v2/ ├── src/ │ └── index.ts # Main MCP server (McpServer + StdioServerTransport) ├── build/ │ └── index.js # Compiled JavaScript (generated by npm run build) ├── test/ │ ├── makeReservation.test.js # Integration tests │ └── availableTimeSlot.test.js # Integration tests ├── .github/workflows/ │ └── azure-deploy.yml # GitHub Actions CI/CD for Azure ├── package.json # Project manifest & scripts ├── tsconfig.json # TypeScript config ├── .env.example # Environment variables template ├── README.md # Full documentation └── ... ``` ## Key Features ✅ **Official MCP SDK:** Uses @modelcontextprotocol/sdk per https://modelcontextprotocol.io/docs/develop/build-server#node ✅ **STDIO Communication:** Proper stdio transport for seamless MCP client integration ✅ **TypeScript:** Fully typed with strict mode ✅ **Zod Validation:** Input validation on all tools/resources ✅ **Error Handling:** Graceful error responses with meaningful messages ✅ **Testing:** Integration tests validate structure and compilation ✅ **CI/CD:** GitHub Actions workflow with test → build → deploy pipeline ✅ **Azure Ready:** Environment variable binding and publish profile deployment ✅ **Logging Safety:** Uses console.error() for STDIO safety (never console.log) ## Quick Start ### Local Development ```bash # Install npm install # Build npm run build # Test npm test # Run npm start ``` ### Azure Deployment 1. Set GitHub Secrets: `AZURE_WEBAPP_NAME`, `AZURE_WEBAPP_PUBLISH_PROFILE` 2. Set App Service Configuration: `SEVENROOMS_API_KEY`, `SEVENROOMS_API_URL` 3. Push to `main` branch → automatic deployment ## API Examples ### make_reservations Tool ```json { "date": "2025-12-25", "time": "19:00", "party_size": 4, "first_name": "John", "last_name": "Doe", "email": "john@example.com", "phone": "555-1234" } ``` ### available_time_slot Resource ``` URI: available://2025-12-25/19:00/4 Response: { "available_times": ["18:00", "18:30", "19:00", "19:30"] } ``` ## Notes for Production Use 1. **API Endpoints:** Adjust the `/reservations` and `/availability` endpoints if your SevenRooms API differs 2. **Auth Headers:** Currently uses `Authorization: Bearer {key}`. Verify this matches your API. 3. **Request Payloads:** The tool sends `{ datetime, party_size, guest: { ... } }`. Adjust if needed. 4. **Availability Filtering:** Resource filters `type === 'book'`. Adjust if your API uses different status values. 5. **Logging:** Always use `console.error()` in STDIO servers, never `console.log()` 6. **Testing in Azure:** Use Application Insights or Azure Monitor for production diagnostics ## Files Modified/Created - ✨ `src/index.ts` — NEW: Official MCP SDK server implementation - ✅ `build/index.js` — GENERATED: Compiled TypeScript - ✨ `tsconfig.json` — NEW: TypeScript configuration - ✅ `package.json` — UPDATED: Added TypeScript deps, build script, type: "module" - ✨ `README.md` — NEW: Comprehensive documentation - ✅ `.env.example` — UPDATED: Removed PORT (Azure-managed) - ✅ `test/*.test.js` — UPDATED: Converted to ES modules, integration tests - ✅ `.github/workflows/azure-deploy.yml` — UPDATED: Added build and test steps ## Test Results ``` available_time_slot resource (integration) ✔ should have compiled JavaScript from TypeScript ✔ should have TypeScript configuration ✔ should compile without errors ✔ should have main server file with tools and resources make_reservations tool (integration) ✔ should have compiled JavaScript ✔ should have valid package.json with build script ✔ should require SEVENROOMS_API_KEY and SEVENROOMS_API_URL env vars 7 passing (8ms) ``` --- ## Next Steps (Optional Enhancements) 1. **Endpoint Customization:** Adjust SevenRooms API paths if needed 2. **Authentication:** Update auth header/method if your API differs 3. **Request Schema:** Modify payload structure to match your SevenRooms account 4. **Monitoring:** Integrate with Application Insights or Azure Monitor 5. **Secrets:** Consider Azure Key Vault for managing API keys 6. **Load Testing:** Use Azure Load Testing before production --- **Status:** ✅ Complete and ready for deployment **Last Updated:** November 20, 2025 **MCP Version:** @modelcontextprotocol/sdk@^1.0.0 **Node Version:** 16+ (18 recommended)

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/csnkarthik/seven-rooms-mcp-v2'

If you have feedback or need assistance with the MCP directory API, please join our Discord server