home / mcp / docs api mcp server
MCP Server generated by mcp.ag2.ai
Configuration
View docs{
"mcpServers": {
"ag2-mcp-servers-google-docs-api": {
"command": "python",
"args": [
"mcp_server/main.py",
"stdio"
],
"env": {
"CONFIG": "JSON string containing configuration",
"SECURITY": "Security parameters like API keys",
"CONFIG_PATH": "Path to JSON config (e.g., mcp_server/mcp_config.json)"
}
}
}
}You run an MCP server that exposes a file-based or URL-based API through the Model Context Protocol, allowing clients to request and interact with the underlying data model using a standardized, scalable transport. This guide shows you how to install, configure, and run the Google Docs API MCP Server locally and how to connect an MCP client to it for practical usage.
You start the server in a local process and connect clients via the MCP transport you choose. The server exposes a ready-to-use MCP endpoint that your client can query to retrieve model context and execute actions. Start the server first, then initialize your MCP client to communicate through the selected transport (stdio in this example). You can adjust configuration through environment variables to point to a JSON config or inline JSON.
Prerequisites: Python 3.9 or newer, and your preferred package manager or execution tool.
# Step 1: Clone the project
git clone <repository-url>
cd mcp_server
# Step 2: Install dependencies (dev mode)
pip install -e ".[dev]"
# Alternative: use uv to install editable dev dependencies
uv pip install --editable ".[dev]"Optional local development tooling is available: you can run linting, static analysis, tests, and pre-commit hooks to ensure code quality.
# Linting and formatting
ruff check
ruff format
# Static analysis
./scripts/static-analysis.sh
# Running tests with coverage
./scripts/test.sh
./scripts/test-cov.sh
# Pre-commit hooks (install once per machine)
pre-commit installTo run the MCP server locally in stdio mode, use the following command. You can switch transport modes by passing a different argument to the main entry point.
python mcp_server/main.py stdioYou can configure the server using environment variables. The following are supported:
- CONFIG_PATH: Path to a JSON configuration file (e.g., mcp_server/mcp_config.json). - CONFIG: A JSON string containing the configuration. - SECURITY: Environment variables for security parameters (e.g., API keys).
Set the following environment variables to customize and secure your MCP server before starting it.
- CONFIG_PATH=/path/to/mcp_config.json
- CONFIG='{"server":"docs_api","transport":"stdio"}'
- SECURITY='{"apiKey":"YOUR_API_KEY"}'Check code for style and potential issues using linting tools such as ruff.
Format code to a consistent style using a formatter like ruff format.
Run static analysis tools (mypy, bandit, semgrep) to catch type issues and security concerns.
Execute the test suite with coverage to verify functionality.
Run pre-commit hooks to enforce quality before commits.