DreamyDetective/sequentialthinking-mcp
Sequential Thinking — Gradio MCP Server
Python Gradio app that exposes Sequential Thinking as an MCP server over SSE, alongside a small UI for manual thought steps. It mirrors the behaviour of the reference Sequential Thinking MCP server (TypeScript) using Gradio’s built-in MCP support (gradio[mcp]).
What’s included
- MCP over HTTP (SSE) — connect any MCP client to the Gradio
/gradio_api/mcp/sseendpoint - Web UI — process thoughts, reset session, inspect history, and copy-paste MCP config
- Structured thinking — revisions, branches, adjustable totals, optional “needs more thoughts”
- Logging — every thought is appended to
logs/chat_logs.jsonl; optional periodic uploads to a Hugging Face dataset whenHF_TOKENandHF_DATASET_REPOare set (see docs/LOGGING.md)
Requirements
- Python 3.10+ recommended
- Dependencies: see requirements.txt (
gradio[mcp]==6.11.0)
Run locally
python -m venv .venv
# Windows: .venv\Scripts\activate
# macOS/Linux: source .venv/bin/activate
pip install -r requirements.txt
python app.pyGradio starts (default http://localhost:7860). MCP SSE URL:
http://localhost:7860/gradio_api/mcp/sse
On Windows, if your default console encoding breaks Gradio’s startup output, use UTF-8, for example:
python -X utf8 app.pyPowerShell helper: run.ps1 expects a virtualenv folder named venv at the repo root (venv\Scripts\python.exe). If you use .venv instead, activate it and run python app.py as above.
MCP tools
sequential_thinking parameters
Names follow the Python implementation (snake_case):
Configure your MCP client
Point the client at the SSE URL (adjust host/port if you change Gradio’s server_name / server_port).
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"sequential-thinking": {
"url": "http://localhost:7860/gradio_api/mcp/sse"
}
}
}VS Code — user or workspace mcp.json
{
"servers": {
"sequential-thinking": {
"url": "http://localhost:7860/gradio_api/mcp/sse"
}
}
}See VS Code MCP documentation for file locations.
Cursor
Add an MCP server entry with the same url as above (for example in your Cursor MCP configuration), with the app running locally.
Environment variables
Details: docs/LOGGING.md.
Hugging Face Spaces
The YAML front matter at the top of this file is for Space deployment. After deploy, use your Space URL for MCP, for example:
https://<your-space-name>.hf.space/gradio_api/mcp/sse
Relation to other packages
The npm package @modelcontextprotocol/server-sequential-thinking and the mcp/sequentialthinking Docker image are separate official distributions. This repository is source for the Gradio/Python app only; it does not ship a Dockerfile or Node build in-tree.
Docs
- docs/LOGGING.md — log format, Hugging Face upload, troubleshooting
- docs/IMPLEMENTATION_SUMMARY.md — logging implementation notes
