Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,15 +60,6 @@ async def create_record_tool(request: mcp_types.CallToolRequest):
|
|
| 60 |
"error": str(e)
|
| 61 |
}
|
| 62 |
|
| 63 |
-
# Create MCP server and transport
|
| 64 |
-
mcp_server = Server( # Removed 'tools' argument
|
| 65 |
-
tool_handlers={
|
| 66 |
-
"list_airtable_records": list_records_tool,
|
| 67 |
-
"create_airtable_record": create_record_tool
|
| 68 |
-
},
|
| 69 |
-
notification_options=NotificationOptions()
|
| 70 |
-
)
|
| 71 |
-
|
| 72 |
# Define tools separately (for Deep Agent to discover them)
|
| 73 |
tools = [
|
| 74 |
mcp_types.Tool(
|
|
@@ -83,6 +74,16 @@ tools = [
|
|
| 83 |
)
|
| 84 |
]
|
| 85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
# Initialize SseServerTransport
|
| 87 |
transport = SseServerTransport("/airtable/mcp")
|
| 88 |
|
|
|
|
| 60 |
"error": str(e)
|
| 61 |
}
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
# Define tools separately (for Deep Agent to discover them)
|
| 64 |
tools = [
|
| 65 |
mcp_types.Tool(
|
|
|
|
| 74 |
)
|
| 75 |
]
|
| 76 |
|
| 77 |
+
# Define tool handlers
|
| 78 |
+
tool_handlers = {
|
| 79 |
+
"list_airtable_records": list_records_tool,
|
| 80 |
+
"create_airtable_record": create_record_tool
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
# Create MCP server
|
| 84 |
+
mcp_server = Server() # Removed all arguments
|
| 85 |
+
mcp_server.tool_handlers = tool_handlers # Set as attribute
|
| 86 |
+
|
| 87 |
# Initialize SseServerTransport
|
| 88 |
transport = SseServerTransport("/airtable/mcp")
|
| 89 |
|