init
This commit is contained in:
14
mcp/Dockerfile.j2
Normal file
14
mcp/Dockerfile.j2
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM {{ base_image | default("python:3.11-slim") }}
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
|
||||
{% set pip_opts = "" %}
|
||||
{% if pip_registry %}
|
||||
{% set pip_opts = "--index-url " ~ pip_registry %}
|
||||
{% endif %}
|
||||
|
||||
RUN pip install --no-cache-dir -U pip
|
||||
RUN pip install --no-cache-dir {{ pip_opts }} fastmcp
|
||||
RUN pip install --no-cache-dir {{ pip_opts }} -r requirements.txt
|
||||
|
||||
CMD ["python", "src/main.py"]
|
||||
13
mcp/src_main.py.j2
Normal file
13
mcp/src_main.py.j2
Normal file
@@ -0,0 +1,13 @@
|
||||
from fastmcp import FastMCP
|
||||
|
||||
mcp = FastMCP(name="{{ node_name }}")
|
||||
|
||||
@mcp.tool()
|
||||
def hello(name: str) -> str:
|
||||
"""
|
||||
This is a tool that says, "Hello!"
|
||||
"""
|
||||
return f"Hello ! {{ node_name }} ! {name} !"
|
||||
|
||||
if __name__ == "__main__":
|
||||
mcp.run(transport="streamable-http", host="0.0.0.0", port=80)
|
||||
Reference in New Issue
Block a user