Minimal production-style MCP demo with:
- GitHub MCP server
- Slack MCP server
- SQLite MCP server
- Gateway with routing, allowlist, logging, and guardrail
- Gemini-based agent loop
mcp/
gateway/gateway.js
servers/
github-server/server.js
slack-server/server.js
sqlite-server/
db.js
server.js
agent/agent.js
shared/mcp-schema.js
.env.example
- Install dependencies:
npm install- Create
.envfrom.env.exampleand fill:
GITHUB_TOKEN=YOUR_GITHUB_TOKEN
SLACK_WEBHOOK_URL=YOUR_SLACK_WEBHOOK
GEMINI_API_KEY=YOUR_GEMINI_KEYUse separate terminals:
node servers/sqlite-server/server.js
node servers/github-server/server.js
node servers/slack-server/server.js
node gateway/gateway.js
node agent/agent.jsAgent CLI supports custom repo and objective:
node agent/agent.js https://github.com/user/repo
node agent/agent.js https://github.com/user/repo "check for security issues"Ports:
- Gateway:
3000 - GitHub server:
4001 - Slack server:
4002 - SQLite server:
4003
All MCP servers expose:
POST /tool- Request:
{ "tool": "tool_name", "input": { ... } } - Response:
{ "output": { ... }, "error": null }
- Single endpoint:
POST /mcp - Namespace routes:
github.*-> GitHub serverslack.*-> Slack serverdb.*-> SQLite server
- Allowlist:
github.get_readmeslack.send_messagedb.log_event
- Guardrail:
- Blocks
github.get_readmeif README content is over 5000 chars
- Blocks
- Logging:
- Every gateway request/response attempts
db.log_event
- Every gateway request/response attempts
- Agent asks Gemini which tool to call first.
- Agent calls gateway with tool JSON.
- Gateway routes call and logs response.
- Agent summarizes README with Gemini.
- Agent sends summary text via
slack.send_message.
- Allowlist rejection
- Send
github.get_latest_committo gateway and verify rejection.
- Send
- Guardrail
- If README exceeds 5000 chars, verify blocked response.
- Logs
- Call sqlite server
get_logsand verify entries exist.
- Call sqlite server
- Agent
- Run
node agent/agent.js https://github.com/user/repo "check for security issues"and verify one full loop.
- Run