- What's MCP (Model Context Protocol)
- Why do we need it (key features and benefits)
- Live Demo with Atlassian MCP Server
- Set up the dev environment
- Creating your first server
- Understand the core building blocks - Tools, Resources, Prompts, Context
- Building a Confluence MCP
- Integrate with VS Code Copilot and Claude Desktop
- Unit test
- Transport protocols
- Authentication
- Remote Server Deployment
- Mounting to FastAPI
- Sampling
- Proxy Server
We have provided step-by-step video tutorials on YouTube to guide you through each project in this course. Each project corresponds to a specific branch name (e.g., project1
, project2
, project3
). Simply follow the instructions below to clone the appropriate branch and you'll have a codebase that matches the starting point of the video for each project.
- Project 1: Watch on YouTube
- Project 2: Watch on YouTube
Happy coding! π
This project uses modern Python development tools to ensure code quality and consistency.
- Python 3.10+
- uv - Fast Python package installer and resolver
-
Clone the project branch:
- Project 1 (Confluence MCP):
git clone -b project1 https://github.com/EuclideanAI/fastmcp-course.git cd fastmcp-course
- Project 2 (Network, Authentication and Remote Server):
git clone -b project2 https://github.com/EuclideanAI/fastmcp-course.git cd fastmcp-course
- Project 3 (Advanced Topics):
git clone -b project3 https://github.com/EuclideanAI/fastmcp-course.git cd fastmcp-course
- Project 1 (Confluence MCP):
-
Install dependencies using uv:
- If you don't have
uv
installed, follow the installation guide. - If
uv
is already installed, sync dependencies:uv sync
- If you don't have
-
Set up pre-commit hooks (recommended):
uv run pre-commit install uv run pre-commit install --hook-type commit-msg
-
Lint your code with Ruff:
uv run ruff check .
-
Format your code with Ruff:
uv run ruff format .
-
Run pre-commit on all files:
uv run pre-commit run --all-files
This project enforces strict code quality standards through automated tools:
We use pre-commit hooks to ensure code quality before commits. The hooks include:
- Ruff: Fast linting and code formatting
- MyPy: Static type checking
- Standard hooks: Trailing whitespace, end-of-file fixes, YAML/TOML validation
- Conventional Commits: Enforces conventional commit message format
This project follows the Conventional Commits specification. All commit messages must follow this format:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Allowed types:
feat
: A new featurefix
: A bug fixdocs
: Documentation only changesstyle
: Changes that do not affect the meaning of the coderefactor
: A code change that neither fixes a bug nor adds a featureperf
: A code change that improves performancetest
: Adding missing tests or correcting existing testschore
: Changes to the build process or auxiliary tools
Examples:
feat: add search functionality to confluence tools
fix: resolve type annotation issues in test files
docs: update README with conventional commit guidelines
test: add unit tests for page operations
The system prompts saved under .github/prompts
outline the code quality standard for copilot coding agent (it will be included as system prompt in every conversation):
- planning.prompt.md
You will need to have the following installed/ready:
- Python 3.10+ (Can install this through uv)
- Confluence instance (Cloud)
- Confluence API credentials
Configure the application via environment variables (create .env
file):
CONFLUENCE_URL="https://your-domain.atlassian.net"
CONFLUENCE_USERNAME="your-email@example.com"
CONFLUENCE_PAT="your-api-token"
Run the FastMCP server with Inspector:
fastmcp dev server.py
Run the FastMCP server as a normal mcp server in local:
uv run server.py
This project includes comprehensive tests for the Confluence client and MCP tools. To run the tests:
uv run pytest
For more verbose output:
uv run pytest -v
To run specific test files:
uv run pytest tests/test_client.py
uv run pytest tests/test_tools.py
The coverage badge at the top of this README is automatically updated via GitHub Actions whenever code is pushed to the main branch.
To run tests with coverage locally:
# Run tests with coverage
uv run pytest
# Manually update the coverage badge (optional - GitHub Actions handles this automatically)
uv run python update_coverage_badge.py
The project includes GitHub Actions workflows that:
- On Push to Main: Automatically runs tests, calculates coverage, and updates the badge in the README
- On Pull Requests: Runs tests and provides coverage information (badge updates only happen on main branch)
The coverage badge shows the current test coverage percentage with color coding:
- π’ Green: 90%+ coverage
- π‘ Yellow-Green: 80-89% coverage
- π‘ Yellow: 60-79% coverage
- π Orange: 50-59% coverage
- π΄ Red: <50% coverage
The Confluence MCP server can be integrated with various AI assistants:
To integrate with VS Code Copilot:
- Ensure the server is running locally with
uv run server.py
- Open VS Code with the Copilot extension installed
- Connect Copilot to the local MCP server
To integrate with Claude Desktop:
- Ensure the server is running locally with
uv run server.py
- Open Claude Desktop
- In settings, add the local MCP server URL (typically
http://localhost:8000
)
fastmcp-course/
βββ server.py # Main FastMCP server entry point
βββ confluence/
β βββ __init__.py # Package initialization
β βββ client.py # Confluence client implementation
β βββ models.py # Data models for Confluence objects
β βββ utils.py # Utility functions
βββ tools/
β βββ __init__.py # Package initialization
β βββ page_tools.py # Tools for page operations
β βββ search_tools.py # Tools for search operations
β βββ comment_tools.py # Tools for comment operations
βββ tests/
β βββ conftest.py # Test configurations and fixtures
β βββ test_client.py # Tests for client functionality
β βββ test_tools.py # Tests for MCP tools
βββ config.py # Configuration management
βββ .env.example # Example environment variables
βββ README.md # Project documentation
[MIT]