An unofficial, embeddable Model Context Protocol provider and standalone server for the CoderPad REST APIs.
Documentation | Swift Package Index
CoderPadMCP gives assistants controlled access to pads, questions, organization data, quota information, and CoderPad Screen assessments. Reads are enabled by default. Create and update tools require an explicit opt-in, and deletion is never exposed.
.package(
url: "https://github.com/adamtheturtle/CoderPadMCP.git",
from: "0.1.0"
)Add the CoderPadMCP product to an application target, or install and run the bundled
coderpad-mcp executable.
CoderPadMCP: Account configuration, MCP tools, prompts, resources, and the reusableCoderPadProvider.CoderPadToolCore: Foundation-only validation and data transforms used by the MCP provider.coderpad-mcp: A stdio server for editors, agents, and other MCP clients.
import CoderPadMCP
import MCPKit
let account = MCPAccount(
name: "Acme",
apiKey: apiKey,
baseURL: URL(string: "https://app.coderpad.io")!,
screenAPIKey: nil,
screenRegion: "us"
)
let accounts = MCPAccountSet(
accounts: [account],
defaultName: account.name,
allowWrites: false
)
let provider = CoderPadProvider(accountSet: accounts)
let server = MCPServer(
name: "My CoderPad integration",
version: "1.0.0",
provider: provider
)The provider implements MCP tools, prompts, resources, resource templates, and resource reads. The host chooses the MCP transport and controls where credentials come from.
Download a signed macOS or Linux executable from GitHub Releases, or build the server from source:
swift build -c release
CODERPAD_API_KEY=your-key swift run coderpad-mcpConfigure an MCP client with the built executable:
{
"mcpServers": {
"coderpad": {
"command": "/absolute/path/to/coderpad-mcp",
"env": {
"CODERPAD_API_KEY": "your-key"
}
}
}
}For multiple accounts, set CODERPAD_MCP_CONFIG to a user-owned JSON file readable
only by that user:
{
"accounts": [
{
"name": "Acme",
"api_key": "secret",
"base_url": "https://app.coderpad.io",
"default": true
}
],
"allow_writes": false
}The default path is ~/.config/coderpad-mcp/config.json.
The provider includes:
- account discovery and identity;
- paginated, compact, counted, and aggregated pad and question queries;
- full pad and question retrieval;
- compact single-file and multi-file pad code;
- organization and quota resources;
- optional CoderPad Screen campaign and test tools;
- review, summary, comparison, and question-drafting prompts;
- opt-in pad and question creation and updates, including dry runs.
API responses are returned as JSON so clients retain fields added by CoderPad without waiting for a library release.
- API keys are never included in MCP results.
- Writes are disabled unless
allowWritesorCODERPAD_MCP_ALLOW_WRITESis enabled. - No delete tools are provided.
- Configuration files reject symbolic links, incorrect ownership, and group/world access.
- Network response sizes and internal pagination are bounded.
- Errors redact response bodies while retaining a diagnostic fingerprint.
- Swift 6.2+
- macOS 15+ or Linux
MIT. See LICENSE.