FastMCP tutorial: build and test a ticket MCP server

Learn to turn an OpenAPI ticket API into MCP tools, add bearer-token authentication, and test a Docker setup on localhost port 8000.

Player not loading? Watch on YouTube

This Codebasics workshop explains how to expose a ticket-management REST API through FastMCP. It starts with tool calling and the roles of an MCP host, client and server, then walks through existing Python code rather than writing every line from scratch. Jira supplies the comparison for the sample ticket system, while a Context7 dashboard demonstration illustrates one-time API-key creation and revocation.

The implementation uses an OpenAPI specification to generate tools instead of wrapping each endpoint manually. The walkthrough covers route names and descriptions, an upstream HTTP client, and custom health, register and revoke endpoints. FastMCP is described as an open source package; the example uses SQLite for credential storage.

Authentication takes much of the session. A service API key identifies the MCP server to the upstream API, while a personal access token authenticates its user. The presenter explains encrypted credential storage, cached JWT sessions and token renewal. The demonstrated personal access token does not expire automatically and requires explicit revocation.

The demo runs through Docker Compose on localhost port 8000. Insomnia creates a token, then MCP Inspector connects over SSE with an Authorization bearer header and calls a ticket-listing tool. Remote deployment and connection to Claude Code remain homework. The session demonstrates server testing, not a completed AI agent integration.