MCP Client Session Example
This example demonstrates how to use the generic MCP Client Session adapter for connecting to MCP servers.
📂 View Source Code
Features​
- Framework: Generic
ClientSessionAdapterfrom mcp-kit - Connection: Direct MCP server communication
- Flexibility: Works with any MCP server implementation
- Async Support: Full asynchronous operation
Setup​
- Install dependencies:
uv sync
- Set up your environment variables (create a
.envfile):
ANTHROPIC_API_KEY=your_anthropic_api_key_here
Usage​
uv run main.py
Configuration​
The proxy_config.yaml file defines a mocked Odoo MCP target that provides accounting tools like:
get_expenses- Retrieve expense recordsget_revenues- Retrieve revenue recordsget_account_balance- Get account balances
The configuration uses LLM-generated responses for realistic accounting data simulation.