home / mcp / mcp agent mcp server
A practical demonstration of AI Agent implementation with custom MCP server.
Configuration
View docs{
"mcpServers": {
"dev-muhammad-mcpagent": {
"command": "python",
"args": [
"start.py",
"--mcp"
],
"env": {
"HOST": "localhost",
"PORT": "8002",
"MCP_HOST": "localhost",
"MCP_PORT": "9002",
"OPENAI_API_KEY": "YOUR_API_KEY"
}
}
}
}You use an MCP-based server to connect an AI agent to tools and APIs, enabling natural-language control over your expense data. This setup lets you manage transactions, generate insights, and interact with multiple clients through a single, extensible MCP interface.
Interact with the AI expense tracker through natural conversation. The AI agent automatically discovers available MCP tools and uses them to add, read, update, or delete expenses, summarize spending, and surface insights. You can query your spending by category, date, or keyword, and receive actionable financial guidance directly in conversation.
Prerequisites: Python and Node.js are required to run the server components and frontend. Make sure Python and npm are available on your system.
# 1) Install Python dependencies for the server
pip install -r server/requirements.txt
pip install agno openai python-dotenv
# 2) Install frontend dependencies (if you want to run the UI)
npm install --prefix client/agent-uiCreate and configure environment variables for OpenAI access and server settings. You will provide your API key and define host/port values for the API and MCP servers.
# Copy example env and edit
cp .env.example .env
# Edit .env to set your OPENAI_API_KEY and server settings
```
```bash
# Initialize and start the servers (in separate terminals)
cd server
python start.py
# Start MCP server only
python start.py --mcp
# Start API server only
python start.py --api
# In another terminal, start the agent
cd agent
python agent.pyThe server suite relies on environment variables to configure OpenAI access and network endpoints. Ensure the following keys are set in your environment or in a .env file used by the startup scripts.
OPENAI_API_KEY=your_key_here
HOST=localhost
PORT=8002
MCP_HOST=localhost
MCP_PORT=9002Create a new expense entry with details such as amount, category, date, and notes.
Retrieve a specific expense by ID or list all expenses.
Modify an existing expense entry by ID with new values.
Remove an expense entry by ID.
Search transactions by keyword or filter by date, category, or type.
Generate a financial summary across a date range, showing totals and trends.
Provide a breakdown of totals by expense category.
Health check endpoint to verify the server is running and responsive.