|
|
import asyncio |
|
|
from fastapi import Request |
|
|
from mcp.server.fastmcp import FastMCP |
|
|
|
|
|
|
|
|
class App02: |
|
|
def __init__(self): |
|
|
self.mcp = FastMCP(name="app02", stateless_http=True) |
|
|
self.register_endpoints() |
|
|
|
|
|
def register_endpoints(self): |
|
|
@self.mcp.resource("app02://status") |
|
|
def app02_status() -> str: |
|
|
"""Status of App02""" |
|
|
return "App02 is running" |
|
|
|
|
|
@self.mcp.tool() |
|
|
def app02_process(data: str) -> str: |
|
|
"""Process data in App02""" |
|
|
return f"App02 Processing: {data}" |
|
|
|
|
|
@self.mcp.tool() |
|
|
def app02_multiply_integers(num1: int, num2: int) -> int: |
|
|
"""Multiply two integers in App02""" |
|
|
return num1 * num2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|