SevenRooms MCP Server
HTTP-based Model Context Protocol (MCP) server exposing tools and resources for SevenRooms reservations and availability. Uses StreamableHTTPServerTransport (HTTP + SSE) instead of stdio. Built with TypeScript and the official @modelcontextprotocol/sdk.
Features
make_reservationstool: Create restaurant reservations with guest detailsavailable_time_slotresource: Query available reservation time slotsTypeScript + Zod validation
Streamable HTTP transport (JSON responses + optional SSE streaming)
Ready for Azure App Service deployment via GitHub Actions
Project Structure
Environment Variables
Name | Required | Description |
SEVENROOMS_API_KEY | Yes | Authentication for SevenRooms API |
SEVENROOMS_API_URL | Yes | Base API URL (e.g. ) |
PORT | Optional | Listening port (App Service sets automatically) |
Copy .env.example to .env for local use:
Local Development
Server endpoints:
POST /mcp– JSON-RPC MCP requests (initialize, tools/list, resources/list, tools/call, etc.)GET /mcp– SSE stream (if using streaming scenarios)DELETE /mcp– Close session (stateful mode; stateless here so optional)GET /health– Simple health probe
Sample Initialize Request
List Tools
Call make_reservations Tool (example)
Tools & Resources Details
Tool: make_reservations
Input fields:
Returns success or detailed error text from SevenRooms API.
Resource: available_time_slot
URI format:
Returns JSON: { "available_times": ["18:00", "18:30", ...] } filtered for entries where type === 'book.
SevenRooms API Endpoints Used
Reservations:
POST {SEVENROOMS_API_URL}/reservationsAvailability:
GET {SEVENROOMS_API_URL}/availabilitywith query paramsdate,time,party_size
Adjust endpoint paths if your SevenRooms account differs.
Azure App Service Deployment
1. Create Azure Resources (CLI Example)
2. Configure App Settings
Azure injects PORT automatically; do not hardcode it unless needed.
3. GitHub Secrets
Add in repo Settings → Actions → Secrets:
AZURE_WEBAPP_NAME= <WEBAPP_NAME>AZURE_WEBAPP_PUBLISH_PROFILE= publish profile XML pasted verbatim
4. Workflow (azure-deploy.yml)
Steps: checkout, setup Node + cache, install (skip if cache hit), test, build, list build output, deploy.
5. Verify Deployment
Logging & Observability
Use
console.error()for server logs (stderr captured by App Service).Add Application Insights: set
APPINSIGHTS_INSTRUMENTATIONKEYor connection string.Consider structured logging (JSON) for easier analysis.
Troubleshooting
Issue | Cause | Fix |
404 /mcp | Build missing or wrong start path | Ensure
and start uses
|
500 SevenRooms errors | Invalid API key or payload | Verify env vars & input fields |
Timeout | Low SKU or network latency | Increase plan size / adjust retry |
Not Acceptable | Missing Accept header | Use
(JSON-only enabled) |
Capabilities error | Missing
in initialize | Include
|
Production Recommendations
Use at least B1 plan; scale out based on CPU or HTTP queue length.
Restrict ingress with Access Restrictions or Front Door.
Rotate
SEVENROOMS_API_KEYregularly.Implement retries for transient SevenRooms failures (429, 5xx).
Add rate limiting if exposed publicly.
Contributing
Branch from
mainImplement changes in
src/npm test && npm run buildPR and merge to trigger deployment
License
MIT (update as needed).
References
MCP Docs: https://modelcontextprotocol.io/
SDK Repo: https://github.com/modelcontextprotocol/typescript-sdk
SevenRooms API Docs: (refer to account-specific portal)
SevenRooms MCP Server
A Model Context Protocol (MCP) server for managing restaurant reservations with SevenRooms. Built according to the MCP specification using TypeScript and the official @modelcontextprotocol/sdk.
Features
make_reservations Tool: Create restaurant reservations with guest details
available_time_slot Resource: Query available reservation time slots
Fully typed with TypeScript and Zod validation
STDIO-based communication for seamless MCP integration
Azure App Service deployment ready
Project Structure
Prerequisites
Node.js >= 16
npm
SevenRooms API key and base URL
Local Development
1. Install Dependencies
2. Configure Environment Variables
Copy .env.example to .env and fill in your SevenRooms credentials:
Then edit .env:
3. Build the Server
This compiles TypeScript to JavaScript in the build/ directory.
4. Run Tests
Expected output:
5. Start the Server
For production:
For development with auto-reload:
The server will start on stdio, ready for MCP clients to connect.
MCP Tools & Resources
Tool: make_reservations
Makes a reservation at a restaurant through SevenRooms.
Input Schema:
Response: Returns the SevenRooms API response with reservation confirmation details (ID, status, etc.).
Resource: available_time_slot
Queries available reservation time slots for a given date, time, and party size.
URI Format:
Example:
Response:
The resource automatically filters to only include times where type === 'book' from the SevenRooms availability API.
SevenRooms API Integration
The server calls the following SevenRooms endpoints:
Reservations Endpoint
URL:
{SEVENROOMS_API_URL}/reservationsMethod: POST
Auth: Bearer token in
AuthorizationheaderPayload:
{ "datetime": "2025-12-25T19:00", "party_size": 4, "guest": { "first_name": "John", "last_name": "Doe", "email": "john@example.com", "phone": "555-1234" } }
Availability Endpoint
URL:
{SEVENROOMS_API_URL}/availabilityMethod: GET
Auth: Bearer token in
AuthorizationheaderQuery Params:
date,time,party_size
Note: Adjust endpoints and request payloads if your SevenRooms API account requires different paths or authentication methods.
Testing
The project includes unit tests using Mocha, Chai, and Nock (for HTTP mocking).
Run tests:
Tests cover:
Input validation for both tool and resource
Mocked SevenRooms API responses
Filtering logic for available time slots (type === 'book')
Azure Deployment
Prerequisites
Azure App Service instance
GitHub repository with this code
Azure publish profile exported
Setup Steps
Create Azure App Service
Create a new Web App (Node.js 18 LTS or later)
Copy the publish profile XML
Configure GitHub Secrets
In your GitHub repository, go to Settings → Secrets and variables → Actions
Add these secrets:
AZURE_WEBAPP_NAME— The name of your Azure Web AppAZURE_WEBAPP_PUBLISH_PROFILE— The publish profile XML content
Set App Service Configuration
In Azure portal, go to your App Service → Configuration
Add these application settings:
SEVENROOMS_API_KEY— Your SevenRooms API keySEVENROOMS_API_URL— Your SevenRooms API base URL (e.g.,https://api.sevenrooms.com)PORT— Leave blank to auto-bind (Azure sets this automatically)
Deploy
Push to
mainbranchGitHub Actions workflow runs automatically
Deployment proceeds to Azure App Service
The workflow is defined in .github/workflows/azure-deploy.yml and:
Checks out the code
Installs dependencies
Builds the TypeScript
Deploys using the publish profile
Verify Deployment
After deployment, you can:
Check the App Service activity log in Azure portal
Review GitHub Actions workflow run logs on GitHub
Test the server by connecting via MCP client pointing to the deployed instance
Logging
Important: The MCP server uses stdio for communication, so logging is restricted:
✅ Use
console.error()for logging (writes to stderr, safe for STDIO-based MCP)❌ Never use
console.log()(writes to stdout, corrupts MCP JSON-RPC messages)
For production, consider:
Redirecting logs to Application Insights via Azure SDK
Using structured logging libraries that write to stderr
Checking Azure App Service logs in the Azure portal
Troubleshooting
"Cannot find module '@modelcontextprotocol/sdk'"
Run
npm installto ensure all dependencies are installedCheck that
@modelcontextprotocol/sdkis inpackage.jsondependencies
Build errors (TypeScript)
Ensure Node.js >= 16 is installed
Delete
build/andnode_modules/and reinstall:npm install && npm run build
Tests failing
Ensure
.envfile exists (even if empty) or set env vars in your shell before running testsCheck that nock mocks match your actual SevenRooms API requests
Server not connecting as MCP client
Ensure the server runs without throwing errors:
npm start(should print to stderr)Verify the MCP client is correctly configured to call the server
Contributing
Make changes to
src/index.tsRun tests:
npm testBuild:
npm run buildCommit and push to trigger CI/CD
License
MIT