mcp-server / numpy_server.py
matsuap's picture
Update Dockerfile to streamline application setup by copying all contents and modifying the command to run multiple Python scripts concurrently.
9c66a8b
raw
history blame
420 Bytes
from fastmcp import FastMCP
import numpy as np
mcp = FastMCP()
@mcp.tool()
def numpy_add(a: list[float], b: list[float]) -> list[float]:
"""Adds two vectors element-wise."""
return np.add(a, b).tolist()
@mcp.tool()
def numpy_multiply(a: list[float], b: list[float]) -> list[float]:
"""Multiplies two vectors element-wise."""
return np.multiply(a, b).tolist()
if __name__ == "__main__":
mcp.run()