Spaces:
Sleeping
Sleeping
Update server.py
Browse files
server.py
CHANGED
|
@@ -1,29 +1,18 @@
|
|
| 1 |
# server.py
|
| 2 |
-
|
| 3 |
from mcp.server.fastmcp import FastMCP
|
| 4 |
import os
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
mcp = FastMCP("OnBase", port=7860)
|
| 9 |
|
| 10 |
@mcp.tool()
|
| 11 |
def get_document_info(id: int):
|
| 12 |
-
"""Gets document information from the client given a document ID."""
|
| 13 |
return {
|
| 14 |
"doc_id": id,
|
| 15 |
"doc_name": "Document Name",
|
| 16 |
-
|
| 17 |
-
"doc_size": 123456,
|
| 18 |
-
"doc_date": "2023-10-01",
|
| 19 |
-
"doc_author": "Author Name",
|
| 20 |
-
"doc_description": "Document description goes here.",
|
| 21 |
-
"doc_tags": ["tag1", "tag2", "tag3"],
|
| 22 |
}
|
| 23 |
|
| 24 |
-
# Asigna el router de FastMCP a nuestra variable router
|
| 25 |
-
router.include_router(mcp.router)
|
| 26 |
-
|
| 27 |
if __name__ == "__main__":
|
| 28 |
-
|
| 29 |
-
uvicorn.run(mcp.app, host="0.0.0.0", port=7860)
|
|
|
|
| 1 |
# server.py
|
| 2 |
+
# server.py
|
| 3 |
from mcp.server.fastmcp import FastMCP
|
| 4 |
import os
|
| 5 |
|
| 6 |
+
port = int(os.getenv("PORT", 7860))
|
| 7 |
+
mcp = FastMCP("OnBase", port=port)
|
|
|
|
| 8 |
|
| 9 |
@mcp.tool()
|
| 10 |
def get_document_info(id: int):
|
|
|
|
| 11 |
return {
|
| 12 |
"doc_id": id,
|
| 13 |
"doc_name": "Document Name",
|
| 14 |
+
# ... resto de tus campos
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
}
|
| 16 |
|
|
|
|
|
|
|
|
|
|
| 17 |
if __name__ == "__main__":
|
| 18 |
+
mcp.run("sse")
|
|
|