Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions src/fetch/Dockerfile

This file was deleted.

5 changes: 5 additions & 0 deletions src/fetch/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
]

dependencies = [
"httpx<0.28",
"markdownify>=0.13.1",
Expand All @@ -23,6 +24,10 @@ dependencies = [
"pydantic>=2.0.0",
"readabilipy>=0.2.0",
"requests>=2.32.3",
# 👇 Added for Smithery HTTP hosting
"uvicorn>=0.30.0",
"starlette>=0.48.0",
"fastapi>=0.111.0",
]

[project.scripts]
Expand Down
9 changes: 9 additions & 0 deletions src/fetch/smithery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: fetch
type: server
runtime: python
startCommand:
- uv
- run
- python
- -m
- mcp_server_fetch
24 changes: 21 additions & 3 deletions src/fetch/src/mcp_server_fetch/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# __main__.py
import os
import uvicorn
from fastapi.middleware.cors import CORSMiddleware
import mcp
from mcp_server_fetch.server import serve
import asyncio

from mcp_server_fetch import main
def main():
transport = os.getenv("MCP_TRANSPORT", "stdio")

main()
if transport in {"http", "streamable-http"}:
app = mcp.streamable_http_app()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=False,
allow_methods=["*"],
allow_headers=["*"],
)
port = int(os.getenv("PORT", "8000"))
uvicorn.run(app, host="0.0.0.0", port=port)
else:
asyncio.run(serve())
Loading