Developer docs

MCP Server

CourseFoundry exposes a Model Context Protocol server so you can read, write, publish, and run AI workflows on your courses from Claude, ChatGPT, the cf CLI, or any MCP-capable client. It speaks JSON-RPC 2.0 over a single HTTPS endpoint and authenticates with a Bearer token.

1. Get an API key

Create a personal key in Settings → API keys. Keys are prefixed cfry_ and shown once - copy it somewhere safe. You can revoke or rename keys at any time.

Prefer the terminal? The cf CLI runs a browser sign-in with cf login, which mints and stores a key for you automatically.

2. Endpoint & auth

EndpointPOST https://www.coursefoundry.com/api/mcp
ProtocolJSON-RPC 2.0
AuthAuthorization: Bearer cfry_…

3. Connect from Claude

Add CourseFoundry as an HTTP MCP server. In Claude Code, drop this into your MCP config (or run claude mcp add and choose the HTTP transport):

{
  "mcpServers": {
    "coursefoundry": {
      "type": "http",
      "url": "https://www.coursefoundry.com/api/mcp",
      "headers": { "Authorization": "Bearer cfry_your_key_here" }
    }
  }
}

4. Connect from ChatGPT

In ChatGPT, add a custom connector (developer mode) pointing at https://www.coursefoundry.com/api/mcp and supply the Authorization: Bearer cfry_… header. ChatGPT will call tools/list to discover the available tools automatically.

5. Raw JSON-RPC

Handshake:

curl -s https://www.coursefoundry.com/api/mcp \
  -H "Authorization: Bearer cfry_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'

Discover tools (authoritative list for your account):

curl -s https://www.coursefoundry.com/api/mcp \
  -H "Authorization: Bearer cfry_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'

Call a tool:

curl -s https://www.coursefoundry.com/api/mcp \
  -H "Authorization: Bearer cfry_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "list_files",
      "arguments": { "courseId": "<your-course-id>" }
    }
  }'

6. What you can do

Call tools/list for the exact, up-to-date set. Broadly, the tools fall into these groups:

Read

list_files, read_file, get the course outline, list references - inspect a course’s structure and content.

Write

write_file, delete_file, and propose_course_changes - create and edit lessons, or stage a reviewable batch of changes.

AI workflows

run_workflow - generate an outline, draft a lesson, build slides or an assessment, or review content.

Publish & version

Commit a snapshot to the linked GitHub repo and trigger publishing flows.

The generic file tools (list_files, read_file, write_file, delete_file) also back the cf CLI’s local folder sync.

Per-course tutor server (no key)

Published, AI-readable courses also expose a read-only public MCP server at /mcp/<username>/<course-slug> - learners point their own Claude or ChatGPT at it to study the course. It offers search and lesson-retrieval tools only, with assessment answers fenced out, and needs no API key. Authors enable it from the course’s publishing settings.

Security

  • Keys are Bearer credentials - treat them like passwords. Revoke compromised keys in Settings.
  • The authenticated endpoint only ever sees courses owned by the key’s account.
  • All traffic is HTTPS; keys are stored hashed and shown only once at creation.