File size: 420 Bytes
9c66a8b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()