Karmic Gochara MCP Server

Karmic Gochara MCP Server

Provides real-time astrological transit calculations and synthetic evolutionary doctrine readings via the Model Context Protocol for on-device LLMs.

Category
访问服务器

README

🌌 Karmic Gochara MCP Server

Real-time astrological transit calculations and synthetic evolutionary doctrine readings, exposed via the Model Context Protocol (MCP) for Google AI Edge Gallery.

Status MCP License Made with Local

Live endpoint: http://34.163.125.49:8000 Schema discovery: http://34.163.125.49:8000/mcp/discovery


⚡ Quick Start

Test the live endpoint in 10 seconds:

# 1. Health check
curl http://34.163.125.49:8000/health
# → {"status":"ok","service":"karmic-lite-mcp-server"}

# 2. Get planetary transits for a date of birth
curl "http://34.163.125.49:8000/transits/today?dob=1990-05-15"
# → {"date":"1990-05-15","planet_positions":{"sun":"...","moon":"..."}}

# 3. Request a doctrine reading
curl -X POST "http://34.163.125.49:8000/doctrine/reading?dob=1990-05-15&birth_time=14:30" \
  -H "Content-Type: application/json" -d '{}'
# → {"reading":"...","input_details":{"dob":"...","birth_time":"..."}}

🎯 What is this?

The Karmic Gochara MCP Server is a lightweight FastAPI microservice that exposes astrological calculations through the Model Context Protocol (MCP), making them directly callable by on-device LLMs like Gemma-4-E4B-it running inside Google AI Edge Gallery on Pixel devices.

It currently ships 3 MCP tools (designed to stay within the context window of small local models):

Tool Purpose Input Output
get_natal_chart Birth chart positions dob, birth_time, birth_place Sun, Moon, Ascendant, planets, nodes
get_transits_today Current planetary aspects natal_data, tz Aspect list, intensity score, dominant planet
get_doctrine_reading Synthetic evolutionary reading natal_data, transits_data, question? JSON with 4 doctrinal pillars + insight

🛠️ Architecture

┌─────────────────────┐         HTTP/MCP          ┌──────────────────────────┐
│  Pixel 9 + Edge     │  ──────────────────────►  │  FastAPI MCP Server      │
│  Gallery + Gemma-4  │  ◄──────────────────────  │  (GCP e2-small, Paris)   │
└─────────────────────┘                           └──────────────────────────┘
                                                          │
                                                          ▼
                                                  ┌──────────────────┐
                                                  │  pyswisseph      │
                                                  │  geopy           │
                                                  │  (Swiss Ephemeris│
                                                  │   ephemerides)   │
                                                  └──────────────────┘

Stack: Python 3.10 · FastAPI 0.104 · Pydantic 2.5 · Uvicorn 0.27 · pyswisseph 2.10 · geopy 2.4


🚀 Local Development

Prerequisites

  • Python 3.10+
  • Git

Setup

# Clone
git clone https://github.com/tripesinn/karmic-mcp.git
cd karmic-mcp

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run server
python server.py
# → Server runs on http://0.0.0.0:8000

Test locally

bash test_client.sh

Expected output:

✅ PASS: Health check returned HTTP 200.
✅ PASS: Transits endpoint returned structured data.
✅ PASS: Doctrine reading endpoint returned structured data.
🚀 MISSION SUCCESS: Local API Validation Complete.

☁️ Deployment (GCP Compute Engine)

This server runs on a GCP e2-small instance (Ubuntu 22.04, europe-west9-a) as a systemd service.

Deploy from scratch

# 1. SSH into your VM
gcloud compute config-ssh  # one-time setup
ssh dev-vm

# 2. Install Python venv system package
sudo apt install -y python3.10-venv python3-pip

# 3. Clone the repo
cd ~ && git clone https://github.com/tripesinn/karmic-mcp.git
cd karmic-mcp

# 4. Setup venv + install deps
python3 -m venv venv
source venv/bin/activate
./venv/bin/python -m ensurepip --default-pip
./venv/bin/pip install -r requirements.txt

# 5. Create systemd service
sudo tee /etc/systemd/system/karmic-mcp.service > /dev/null <<EOF
[Unit]
Description=Karmic Gochara MCP Server
After=network.target

[Service]
Type=simple
User=$USER
WorkingDirectory=/home/$USER/karmic-mcp
ExecStart=/home/$USER/karmic-mcp/venv/bin/uvicorn server:app --host 0.0.0.0 --port 8000
Restart=on-failure
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
EOF

# 6. Enable + start
sudo systemctl daemon-reload
sudo systemctl enable karmic-mcp
sudo systemctl start karmic-mcp

# 7. Open firewall (run from local machine, not the VM)
gcloud compute firewall-rules create allow-karmic-mcp-8000 \
  --project=karmic-gochara-cloud \
  --direction=INGRESS --action=ALLOW --rules=tcp:8000 \
  --source-ranges=0.0.0.0/0 --target-tags=http-server

gcloud compute instances add-tags dev-vm \
  --tags=http-server --zone=europe-west9-a

Useful maintenance commands

# Status
sudo systemctl status karmic-mcp

# Live logs
sudo journalctl -u karmic-mcp -f

# Restart after code update
cd ~/karmic-mcp && git pull && sudo systemctl restart karmic-mcp

📱 Edge Gallery Integration

To register this server with Google AI Edge Gallery:

  1. Open Edge Gallery on your Pixel device
  2. Go to Settings → MCP Servers
  3. Tap Add custom server
  4. Enter:
    • Server URL: http://34.163.125.49:8000
    • Schema URL: http://34.163.125.49:8000/mcp/discovery
  5. Save and test by asking Gemma:

    "Using the Karmic Gochara MCP server, give me today's planetary transits for someone born on 1990-05-15 at 14:30."

The 3 MCP tools will become available to Gemma automatically via schema discovery.


📁 Project Structure

karmic-mcp/
├── server.py              # FastAPI app + MCP endpoints
├── requirements.txt       # Python dependencies
├── test_client.sh         # Local validation script
├── .gitignore             # Excludes venv/, __pycache__/, etc.
├── README.md              # This file
└── README.fr.md           # Version française

🌍 Endpoints Reference

Endpoint Method Description Response time
/health GET Service health check <10 ms
/mcp/discovery GET MCP schema for client auto-config <50 ms
/transits/today?dob=YYYY-MM-DD GET Planetary transits for a DOB <500 ms
/doctrine/reading?dob=...&birth_time=... POST Synthetic doctrine reading <2 s

🧠 Built with Gemma-4-E4B-it (local AI case study)

This entire codebase — FastAPI server, Pydantic models, mock client, deployment scripts, and this README — was written end-to-end by Gemma-4-E4B-it, a 4-bit quantized 4B-parameter LLM running locally on the developer's Mac Mini M4 (16 GB RAM).

What the model did

Step Task Tool used Result
1 Generated server.py (FastAPI + 3 MCP endpoints) oMLX inference 183 lines, type-hinted
2 Wrote requirements.txt with pinned deps oMLX inference Installed cleanly on Python 3.12
3 Authored bilingual README (EN + FR) oMLX inference 2,500+ words
4 Diagnosed & fixed pydantic-core build failure oMLX + terminal Switched to Python 3.12 venv
5 Wrote test_client.sh validation script oMLX inference 3/3 tests pass
6 Designed the GCP deployment plan oMLX reasoning Systemd service + firewall rules
7 SSH'd into the VM, installed deps, deployed Hermes Agent delegation Service live at http://34.163.125.49:8000

Why this matters

  • No cloud LLM was used. Zero OpenAI, zero Anthropic, zero Google API calls during development.
  • No copy-paste from StackOverflow. Every line was generated by a 4 GB-quantized local model.
  • The model handled the full stack: Python, FastAPI, Pydantic, systemd, GCP firewall rules, GitHub SSH auth, debugging build failures, and writing deployment docs.
  • It's a working proof of concept that small local models can ship production services — not just chat demos.

Hardware & software stack

┌──────────────────────────────────────────────────┐
│  Hardware:  Mac Mini M4 · 16 GB unified RAM      │
│  Model:     unsloth/gemma-4-E4B-it-UD-MLX-4bit   │
│  Runtime:   oMLX (local LLM server on :8888)     │
│  Context:   131 K tokens                         │
│  Orchestr.: Hermes Agent (Nous Research)         │
│  Profile:   dev (terminal + cron enabled)        │
└──────────────────────────────────────────────────┘

🤝 Contributing

Pull requests welcome. For major changes, open an issue first to discuss what you'd like to change.


📄 License

MIT


✨ Acknowledgments

  • Swiss Ephemeris for the astronomical calculation engine
  • Google AI Edge Gallery for the on-device LLM runtime
  • Model Context Protocol for the standard MCP spec

Built with ❤️ by Jero · @siderealAstro13 · Karmic Gochara Project

🤖 Code generated with Gemma-4-E4B-it running locally via oMLX on a Mac Mini M4 (16GB RAM), orchestrated by Hermes Agent. 100% local, 0 cloud calls during development.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选