Skip to content

lovestaco/mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP Gateway Demo

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

Project Structure

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

Setup

  1. Install dependencies:
npm install
  1. Create .env from .env.example and fill:
GITHUB_TOKEN=YOUR_GITHUB_TOKEN
SLACK_WEBHOOK_URL=YOUR_SLACK_WEBHOOK
GEMINI_API_KEY=YOUR_GEMINI_KEY

Run Order

Use 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.js

Agent 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

MCP Contract

All MCP servers expose:

  • POST /tool
  • Request: { "tool": "tool_name", "input": { ... } }
  • Response: { "output": { ... }, "error": null }

Gateway Behavior

  • Single endpoint: POST /mcp
  • Namespace routes:
    • github.* -> GitHub server
    • slack.* -> Slack server
    • db.* -> SQLite server
  • Allowlist:
    • github.get_readme
    • slack.send_message
    • db.log_event
  • Guardrail:
    • Blocks github.get_readme if README content is over 5000 chars
  • Logging:
    • Every gateway request/response attempts db.log_event

Demo Flow

  1. Agent asks Gemini which tool to call first.
  2. Agent calls gateway with tool JSON.
  3. Gateway routes call and logs response.
  4. Agent summarizes README with Gemini.
  5. Agent sends summary text via slack.send_message.

Quick Manual Verification

  1. Allowlist rejection
    • Send github.get_latest_commit to gateway and verify rejection.
  2. Guardrail
    • If README exceeds 5000 chars, verify blocked response.
  3. Logs
    • Call sqlite server get_logs and verify entries exist.
  4. Agent
    • Run node agent/agent.js https://github.com/user/repo "check for security issues" and verify one full loop.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors