Testing with a Local Development MCP Server
You can modify the settings of your MCP client to run your local server. Open your client json settings file and update it as needed. Example configuration:<path to your cloned repo> with the absolute path to your cloned repository, for example /Users/myuser/dev/oci-mcp.
Testing HTTP Transport Mode
To build and test servers running in HTTP transport mode:The
type attribute differs across MCP clients; some use http as the transport value while others (like Cline) expect streamableHttp.Using the MCP Inspector
The Model Context Protocol (MCP) provides Inspector, a developer tool for testing and debugging MCP servers.What is Inspector?
Inspector is an interactive debugging interface that allows you to:- Test MCP tools and resources
- Inspect server capabilities
- Debug request/response cycles
- Validate server behavior
Running Inspector
The Inspector runs directly through npx without requiring installation. To inspect your locally developed server:Running Automated Tests
Linting
Run linting checks across all servers:ruff to check code quality and style across all Python MCP servers.
Unit Tests
Run the full test suite:- Runs
pytestin each server directory - Collects code coverage data
- Generates coverage reports (HTML and terminal)
- Combines coverage across all servers
- Fails if coverage is below 69%
Test Output
The test command generates:- Terminal output: Shows test results and coverage summary
- HTML coverage report: Available in
htmlcov/index.html - Coverage data files: Individual
.coverage.*files per server
Running Tests for a Specific Server
To test a single server:End-to-End Tests
Run end-to-end tests using Behave:- Builds all servers (
make build) - Installs all servers (
make install) - Runs Behave tests from
tests/e2e/features
Test Requirements
Test dependencies are defined in each server’spyproject.toml:
uv sync or use the development commands.
Coverage Configuration
Coverage settings are defined inpyproject.toml:
Writing Tests
When writing tests:- Test file location: Place tests in
oracle/<server_name>/tests/ - Test file naming: Use
test_*.pypattern - Test function naming: Use
test_*pattern - Use fixtures: Leverage pytest fixtures for common setup
- Mock external calls: Mock OCI API calls to avoid requiring live credentials
- Test error cases: Include tests for error handling and edge cases
