cc-solutions-mcp
by Null-logic-0
README.md
# cc-solutions-mcp
An [MCP](https://modelcontextprotocol.io) server that lets AI coding agents find community solutions to [Coding Challenges](https://codingchallenges.fyi), using the [Shared Solutions](https://github.com/CodingChallengesFYI/SharedSolutions) repository.
Built for the [MCP Server coding challenge](https://codingchallenges.fyi/challenges/challenge-mcp/).
## Features
- Find challenges by full or partial name, and filter their solutions by programming language
- Runs locally over **stdio**, or remotely over **Streamable HTTP** with bearer auth and rate limiting
- Supports both MCP protocol versions (2026-07-28 and the older 2025 handshake)
- Finds solution pages the README doesn't link, using the GitHub API
- HTTP caching with ETag revalidation, retries with backoff, and a stale fallback when GitHub is down
- Structured JSON logs, validated configuration, Docker image, 100+ tests
## Tools, resources and prompts
| Tool | What it does | Example input |
| ------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------- |
| `CodingChallengesSolutionFinder` | Finds challenges by full or partial name and links to their solutions | `{ "challenge": "redis" }` |
| `CodingChallengesSolutionsByLanguage` | Lists one challenge's solutions in a given language | `{ "challenge": "redis server", "language": "Go" }` |
| `hello` | Returns `Hello, <name>`, for checking the connection | `{ "name": "Luka" }` |
Names are matched case-insensitively, and languages accept common aliases (`golang`, `ts`, `node`).
- **Resources:** `challenges://index` lists every challenge; `challenges://solutions/{slug}` shows one challenge's solutions grouped by language (slugs autocomplete).
- **Prompts:** `find-solutions` and `compare-with-community` (compares your implementation with community solutions).
## Quick start
Requires Node.js 26 or later.
```sh
git clone https://github.com/Null-logic-0/cc-solutions-mcp.git
cd cc-solutions-mcp
npm install
npm run build
```
### Use with Claude Code
```sh
claude mcp add --scope user --transport stdio cc-solutions \
-- "$(which node)" "$(pwd)/dist/index.js"
claude mcp list # should show: cc-solutions ... ✔ Connected
```
Then ask Claude something like: _"Show me Go solutions to the Redis server coding challenge."_
Any other MCP client works too: run `node dist/index.js` over stdio.
### Try it with MCP Inspector
```sh
npm run inspect # web UI
npx mcp-inspector --cli node src/index.ts --method tools/list
```
## Run as a remote server
```sh
MCP_TRANSPORT=http MCP_AUTH_TOKEN=$(openssl rand -hex 32) npm start
# → http://127.0.0.1:3000/mcp (health check: GET /healthz)
```
Clients must send `Authorization: Bearer <MCP_AUTH_TOKEN>`. With Claude Code:
```sh
claude mcp add --transport http cc-solutions-remote http://127.0.0.1:3000/mcp \
--header "Authorization: Bearer <token>"
```
### Docker
```sh
docker build -t cc-solutions-mcp .
docker run -p 3000:3000 -e MCP_AUTH_TOKEN=<token> cc-solutions-mcp
```
The image runs the HTTP transport as a non-root user, with a built-in health check. When serving under a domain name, add it to `ALLOWED_HOSTS` (e.g. `-e ALLOWED_HOSTS=mcp.example.com`), and pass `-e GITHUB_TOKEN=<token>` to avoid GitHub's anonymous rate limit.
## Configuration
All settings are environment variables, validated at startup. Invalid values stop the server with a list of every problem.
| Variable | Default | Purpose |
| -------------------------------------------- | --------------------------- | ------------------------------------------------------------------------ |
| `MCP_TRANSPORT` | `stdio` | `stdio` or `http` |
| `MCP_AUTH_TOKEN` | — | Bearer token, at least 32 characters (required for `http`) |
| `HOST` / `PORT` | `127.0.0.1` / `3000` | HTTP listen address |
| `ALLOWED_HOSTS` | `localhost,127.0.0.1,[::1]` | Accepted `Host` headers (DNS rebinding protection) |
| `RATE_LIMIT_PER_MINUTE` | `60` | Requests per client IP per minute |
| `GITHUB_TOKEN` | — | Optional: raises the GitHub API limit from 60 to 5,000 requests per hour |
| `LOG_LEVEL` | `info` | `debug`, `info`, `warn` or `error` (JSON logs on stderr) |
| `HTTP_TIMEOUT_MS` | `5000` | Timeout per GitHub request |
| `CACHE_DEFAULT_TTL_MS` / `CACHE_MAX_ENTRIES` | `60000` / `200` | HTTP cache settings |
## How it works
The server builds its challenge list from the Shared Solutions README, plus the GitHub API to catch pages the README doesn't link. For a language query it reads that challenge's solutions table and normalizes the free-text language column (54 spellings such as `Golang/React` or `NodeJS(Typescript)`). Responses are cached and revalidated with ETags, transient failures are retried with backoff, and if GitHub is unreachable the server falls back to the last list it loaded, marked as stale.
```
src/
├── index.ts entry point: config, transport (stdio or HTTP), shutdown
├── app.ts long-lived dependencies: HTTP cache and challenge catalog
├── server.ts builds an MCP server: tools, resources, prompts
├── config.ts environment variables, validated with Zod
├── tools/ MCP tools
├── resources/ MCP resources
├── prompts/ MCP prompts
├── services/ GitHub access, parsing, search, caching (no MCP code)
├── http/ HTTP transport: auth, rate limiting, request pipeline
└── lib/ errors, retries, logging
```
## Development
```sh
npm run dev # run from source
npm test # unit and integration tests
npm run check # type check, lint, format check and tests
npm run test:live # contract tests against the real GitHub
```
## License
[MIT](LICENSE)
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues