← Back to MCP Pytest Server
Install MCP Pytest Server
Pick your client, copy the command, done.
Manual setup required. We don't have a verified install command for this server. Follow the maintainer README and use the raw config below as a starting point.
1
Prepare the server locally
Run this once before adding it to Claude Code.
pip install -r requirements.txt2
Add it to Claude Code
Paste the maintainer's config below, then edit any placeholder values.
{
"mcp_servers": {
"pytest_server": {
"command": "python",
"args": [
"-m",
"src.main"
],
"env": {
"DATABASE_URL": "sqlite:///./test_results.db"
}
}
}
}See the mcp-pytest-server README for full setup instructions.
Required:
DATABASE_URLEnvironment Variables
Set these before running MCP Pytest Server.
VariableDescriptionRequired
DATABASE_URLDatabase connection string for storing test resultsYesAvailable Tools (3)
Once configured, MCP Pytest Server gives your AI agent access to:
run_pytest_testsExecutes pytest tests and returns the results and report.test_pathoptionsstore_test_resultsStores test results into the database.test_resultsget_test_historyRetrieves historical test records from the database.limitprojectTry It Out
After setup, try these prompts with your AI agent:
→Run the pytest tests located in the /tests directory and summarize the failures.
→Store the latest test execution results into the QA database.
→Show me the history of the last 10 test runs for the current project.
→Execute the test suite with verbose output enabled.
Prerequisites & system requirements
- An MCP-compatible client (Claude Code, Cursor, Windsurf, Claude Desktop, or Codex)
- Python 3.8+ with pip installed
DATABASE_URL— Database connection string for storing test results
Alternative installation methods
Manual
python -m src.mainKeep this setup from going cold
Save the docs, env vars, and workflow around MCP Pytest Server in Conare so Claude Code, Codex, and Cursor remember it next time.