Skip to content

Commit f269cf1

Browse files
committed
dummy mcp server working
1 parent 1703a22 commit f269cf1

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ requests
22
python-dotenv
33
google-cloud-firestore
44
google-auth
5-
jwt
5+
jwt
6+
mcp[cli]
7+
httpx

spendee/spendee_mcp.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from mcp.server.fastmcp import FastMCP
2+
import logging
3+
4+
# to start (after .venv setup):
5+
# python spendee/spendee_mcp.py
6+
7+
# to test:
8+
# DANGEROUSLY_OMIT_AUTH=true mcp dev spendee/spendee_mcp.py
9+
# Then on the url: http://localhost:6274/
10+
# setup "Transport Type" to "Streamable HTTP"
11+
# and "Server URL" to "http://localhost:8000/mcp"
12+
13+
logging.basicConfig(level=logging.DEBUG)
14+
mcp = FastMCP("spendee", host="0.0.0.0", port=8000)
15+
16+
@mcp.tool()
17+
def get_wallets():
18+
# Hardcoded example wallets
19+
example_wallets = [
20+
{"id": 1, "name": "Main Account", "currency": "USD", "balance": 1234.56},
21+
{"id": 2, "name": "Savings", "currency": "EUR", "balance": 7890.12},
22+
]
23+
return example_wallets
24+
25+
if __name__ == "__main__":
26+
mcp.run(transport="streamable-http")
27+
28+
# relevant URLs for learning:
29+
# - https://modelcontextprotocol.io/specification/2025-06-18/server/tools
30+
# - https://www.aibootcamp.dev/blog/remote-mcp-servers
31+
# - https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_configuration-format
32+
# - https://docs.anthropic.com/en/docs/claude-code/mcp
33+
# - https://modelcontextprotocol.io/docs/tools/debugging
34+
# - https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#session-management
35+
# - https://github.com/modelcontextprotocol/python-sdk?tab=readme-ov-file#authentication

0 commit comments

Comments
 (0)