Self-hosted MCP server connecting AI tools to GitHub, Gmail, Google Calendar, Cloudflare, and AWS
Project description
GhostServer
Self-hosted MCP server that connects any AI tool to your real accounts. Your tokens never leave your machine.
Works with Claude Code, Cursor, VS Code Copilot, Windsurf, and any MCP-compatible client.
Why
Every "MCP server" out there is either a setup wizard pointing at someone else's cloud, or locked to one AI vendor. GhostServer runs locally, stores credentials in your own vault, and speaks standard MCP protocol so any client can use it.
21 Tools, 5 Services
| Service | Tools |
|---|---|
| GitHub | list repos, create issues, list/get PRs, search code |
| Gmail | search, read, send, list labels |
| Google Calendar | list events, create events, free/busy, get event |
| Cloudflare | list zones, DNS records, create DNS, list Workers |
| AWS | S3 buckets/objects, EC2 instances, CloudWatch metrics |
Install
pip install ghostserver
Or from source:
git clone https://github.com/adam-scott-thomas/ghostserver.git
cd ghostserver
pip install -e ".[dev]"
Quick Start
1. Configure
cp ghostserver.toml.example ghostserver.toml
Edit ghostserver.toml — enable the services you want and set your credential references.
2. Store Credentials
GhostServer supports three credential backends:
Environment variables (simplest):
[server]
credential_backend = "env"
[github]
enabled = true
token_ref = "GITHUB_TOKEN"
export GITHUB_TOKEN="ghp_your_token_here"
Credentials file (no env pollution):
[server]
credential_backend = "file"
credential_file = "~/.ghostserver/credentials"
[github]
enabled = true
token_ref = "GITHUB_TOKEN"
# ~/.ghostserver/credentials
GITHUB_TOKEN=ghp_your_token_here
CLOUDFLARE_TOKEN=your_cf_token
1Password CLI (most secure):
[server]
credential_backend = "op"
[github]
enabled = true
token_ref = "op://Development/GitHub PAT/credential"
Auto-detect (default): tries 1Password, then credentials file, then env vars.
3. Google Services (one-time setup)
Gmail and Google Calendar require OAuth. Run the setup wizard once:
python -m ghostserver.google_auth
This opens your browser, gets consent, and stores the refresh token in your chosen backend.
4. Connect to your AI tool
Claude Code:
claude mcp add --transport stdio ghostserver -- python -m ghostserver
Cursor / VS Code: Add to your MCP settings:
{
"ghostserver": {
"command": "python",
"args": ["-m", "ghostserver"]
}
}
Any MCP client (stdio):
python -m ghostserver
Architecture
Your AI Tool (Claude Code, Cursor, etc.)
|
| MCP protocol (stdio)
|
v
GhostServer (local process)
|
|-- spine (frozen config registry)
|-- gate (per-service rate limiting + enabled checks)
|-- token store (pluggable: 1Password / env / file)
|
|-- GitHub adapter ──> api.github.com
|-- Gmail adapter ──> gmail.googleapis.com
|-- Calendar adapter ──> googleapis.com/calendar
|-- Cloudflare adapter ──> api.cloudflare.com
|-- AWS adapter ──> boto3 (local credentials)
Every adapter is a single file. The gate enforces rate limits per service. Spine provides the frozen config singleton so adapters don't pass objects around.
Adding Your Own Adapter
Create src/ghostserver/adapters/myservice.py:
from fastmcp import FastMCP
from spine import Core
from ghostserver.gate import check_gate
SERVICE = "myservice"
server = FastMCP("My Service")
@server.tool
async def myservice_do_thing(param: str) -> dict:
"""Description for the AI client."""
check_gate(SERVICE)
tokens = Core.instance().get("tokens")
token = tokens.get(Core.instance().get("config").myservice.token_ref)
# ... call your API ...
return {"result": "done"}
Add the service config to config.py, add the module name to adapters/__init__.py, done. Submit a PR.
Development
git clone https://github.com/adam-scott-thomas/ghostserver.git
cd ghostserver
pip install -e ".[dev]"
pytest -v
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ghostserver-0.1.0.tar.gz.
File metadata
- Download URL: ghostserver-0.1.0.tar.gz
- Upload date:
- Size: 35.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7293c89837e19c18f70fff9138b674fe81982dee94e10412482fc2dba0428b0
|
|
| MD5 |
ba3b0faead802eed024221aa6cdfda72
|
|
| BLAKE2b-256 |
898080f5b3077eabe37ce3d939a97ffec4f682b23de420c03798a324b1513465
|
File details
Details for the file ghostserver-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ghostserver-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6a711d4e530948562484c9a5c16da16961b9e2e31180c0fd4ebeddf442ae929
|
|
| MD5 |
2b4a7222262dd6caf8de027914525ece
|
|
| BLAKE2b-256 |
9968be0f8fbed16c3375b03648905b44d1c59d801a469d7e029c440fed6d1ba4
|