Skip to content

feat(api): add FastAPI REST API for MCP server consumption#33

Merged
spideystreet merged 17 commits intodevelopfrom
feature/api-rest
Mar 10, 2026
Merged

feat(api): add FastAPI REST API for MCP server consumption#33
spideystreet merged 17 commits intodevelopfrom
feature/api-rest

Conversation

@spideystreet
Copy link
Copy Markdown
Collaborator

Summary

  • Add a read-only FastAPI REST API (src/services/api/) exposing project search, detail, similarity (pgvector), trending recommendations, and reference data (categories, domains, techstacks)
  • Consumed by ost-mcp MCP server to surface project discovery tools in Claude Desktop and IDEs
  • Rate-limited (60 req/min/IP via slowapi), isolated Docker container (minimal env, no Dagster/LLM secrets)

Endpoints

Method Path Description
GET /health Health check
GET /projects/search?q=... Keyword search with category/domain/techstack filters
GET /projects/{id} Project detail with relations
GET /projects/{id}/similar pgvector cosine similarity
GET /recommendations/trending Globally trending projects
GET /categories List categories
GET /domains List domains
GET /techstacks List tech stacks

Test plan

  • 20 unit tests (config, database, schemas, all routes)
  • 9 MCP contract tests (verify response shapes match ost-mcp TypeScript types)
  • ruff lint + format clean
  • mypy strict — 0 errors
  • 91% code coverage
  • Live-tested all endpoints against real DB
  • Security audit passed (env isolation, rate limiting, no ILIKE injection)

🤖 Generated with Claude Code

Co-Authored-By: spidecode-bot 263227865+spicode-bot@users.noreply.github.com

spideystreet and others added 17 commits March 10, 2026 14:49
Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
- Isolate API container env (no Dagster/GitHub/LLM secrets)
- Move healthcheck to production compose (not just override)
- Remove shared volumes from API service
- Add rate limiting (60 req/min/IP) on all routes via slowapi decorators
- Extract limiter to rate_limit.py to avoid circular imports

Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
- CLAUDE.md: add API run command, env vars (API_HOST, API_PORT, API_RATE_LIMIT)
- architecture.md: add REST API section, update Docker services count, add serving layer to data flow
- Bump docs submodule with rest-api.mdx page

Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
Verify API response shapes match ost-mcp TypeScript types exactly.
Catches breaking changes in field names, types, or structure before
they reach the MCP server.

Co-Authored-By: spidecode-bot <263227865+spicode-bot@users.noreply.github.com>
@spideystreet spideystreet merged commit 556a21a into develop Mar 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant