How stamenov/stackexchange_mcp_python_server works
Project type and purpose
• This repository delivers two sibling “MCP servers” (Model Context Protocol servers) that expose a Stack Overflow search-and-answer service:
• A production-ready Python implementation (mcp-stackexchage-python)
• An experimental TypeScript version (mcp-stackexchage-ts)
• Both accept a natural-language query and return the best matching question(s) plus accepted or top-voted answers via a simple stdio transport or CLI.
File structure
• Top-level:
– README.md – global overview
– mcp-stackexchage-python/
– mcp-stackexchage-ts/
• Python folder:
– main.py – CLI entrypoint for one-off queries
– server.py – long-running MCP server process
– pyproject.toml + uv.lock – build and dependency declarations
– .python-version, .gitignore
• TypeScript folder:
– stackoverflow-mcp.ts – single-file MCP server + CLI
– package.json – dependencies (@modelcontextprotocol/sdk, tsx, zod)
README for additional insights
• The Python server implements a four-pass search strategy (A–D), cross-site fallback, intelligent re-ranking, tag/date filtering, and an optional API key
• The TypeScript variant offers a pared-down flow, Zod validation, and basic similar-question lookup
• Both expose the same MCP methods (so.search_and_answers, ping)