home / mcp / api discovery service mcp server
MCP Server generated by mcp.ag2.ai
Configuration
View docs{
"mcpServers": {
"ag2-mcp-servers-api-discovery-service": {
"command": "python",
"args": [
"mcp_server/main.py",
"stdio"
],
"env": {
"CONFIG": "A JSON string containing the configuration",
"SECURITY": "Security-related parameters such as API keys",
"CONFIG_PATH": "Path to a JSON configuration file (e.g., mcp_server/mcp_config.json)"
}
}
}
}You run an MCP Server to expose model context for a given API spec, enabling clients to fetch, resolve, and interact with the underlying OpenAPI-driven model ecosystem. This server automates the provisioning of context-aware capabilities so clients can perform MCP-enabled operations against the Google API Discovery spec.
Start the MCP server in stdio mode to interact with clients locally. Run the server with the standard Python entry point and expose the MCP interface on the chosen I/O channel. You can customize startup behavior using environment variables to point at a configuration file or provide a JSON configuration inline.
Prerequisites include Python 3.9+ and pip along with uv for convenient running. Follow these concrete steps to install and prepare the server.
# 1) Clone the repository
git clone <repository-url>
cd mcp-server
# 2) Install dependencies (editable dev install)
pip install -e ".[dev]"
# Alternative: install via uv for editable dev mode
uv pip install --editable ".[dev]"
```} ]},{Optionally, you can run tests and static analysis, but these are not required for a basic server run. The project uses linting, static analysis, and tests to help you validate changes.
You start the MCP server using the Python entry script in stdio mode. Use environment variables to provide configuration at runtime.
python mcp_server/main.py stdio
```} ,{Environment variables you can use include the following. Define a JSON configuration via CONFIG or point to a path with CONFIG_PATH. You can also supply security-related parameters via SECURITY.
CONFIG_PATH=/path/to/mcp_config.json
# or
CONFIG='{"mcpServers": {"api_discovery": {"type": "stdio", "command": "python", "args": ["mcp_server/main.py","stdio"]}}}'
SECURITY={"API_KEY":"YOUR_API_KEY"}
```}]} ,{The server supports different transport modes and reads configuration from the provided JSON or environment as described. If you supply a JSON configuration, ensure it contains the MCP server definitions you intend to run.
Check code quality and consistency using a linter to catch issues early.
Apply code formatting to maintain a consistent style across the project.
Run static analysis tools (type checks, security checks, and style checks) to identify potential issues.
Execute the test suite with coverage reporting to validate behavior.
Install and run pre-commit hooks to enforce quality before commits.