Skip to main content

Prerequisites

Before you begin, make sure you have:
  • Python 3.12+ — check with python --version
  • uv — the package manager used for this project. Install it from docs.astral.sh/uv
  • A GroupMe access token — see Authentication for how to get one

Local setup

1

Clone the repository

2

Install dev dependencies

This installs all runtime and development dependencies, including pytest, ruff, bandit, and pre-commit.
3

Install pre-commit hooks

This installs the git hooks that run ruff and bandit automatically before each commit.
4

Set your GroupMe token

5

Run the server

This starts the server in development mode.
uv run mcp dev opens the MCP Inspector in your browser automatically. The Inspector lets you call any tool manually and inspect request and response payloads — no AI client required.

Running tests

Tests use pytest-httpx to mock HTTP requests and pytest-asyncio with asyncio_mode = "auto" so async test functions run without needing @pytest.mark.asyncio.
Test files set GROUPME_TOKEN in the environment using os.environ.setdefault before importing client. Make sure this is present in any new test file you create.
Run all tests:
Run a single test:
Tests use HTTPXMock to intercept outgoing httpx requests at the transport level. No real GroupMe API calls are made during the test suite.

Lint and format

The project uses ruff for linting and formatting, and bandit for security checks. Both run as pre-commit hooks. To run all checks manually against every file:
This runs:
  • ruff --fix — lint and auto-fix
  • ruff-format — format code
  • bandit -c pyproject.toml — security scan (excludes tests/)

Adding a new tool

1

Add the client method

Add an async method to GroupMeClient in src/groupme_mcp/client.py. Use the existing _get, _post, or _delete helpers to make the request — they inject the token automatically.
2

Add the MCP tool

Add a @mcp.tool() function in src/groupme_mcp/server.py that delegates to the client method. Include a docstring with an Args: block — FastMCP uses it to generate the tool’s schema.
3

Add tests

Add an HTTP-level test in tests/test_client.py that uses HTTPXMock to mock the GroupMe API response, and a tool-level test in tests/test_server.py that calls the tool function directly.