mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 07:09:11 +02:00
Trim fastmcp.types to FastMCP-unique types only
fastmcp.types re-exported 29 mcp_types symbols verbatim, which was pointless indirection users had to discover. It now holds only Textarea, the one type FastMCP actually defines; everything else imports from mcp_types directly. These mirrors were added during unreleased SDK v2 migration work and never shipped, so this is not a breaking change.
This commit is contained in:
parent
9d9bf2b717
commit
e32a2098f9
22 changed files with 60 additions and 165 deletions
|
|
@ -11,10 +11,10 @@ from functools import wraps
|
|||
from typing import Any
|
||||
|
||||
import yaml
|
||||
from mcp_types import TextContent
|
||||
|
||||
from fastmcp import Client, FastMCP
|
||||
from fastmcp.tools import ToolResult
|
||||
from fastmcp.types import TextContent
|
||||
|
||||
|
||||
def with_serializer(serializer: Callable[[Any], str]):
|
||||
|
|
|
|||
|
|
@ -9,10 +9,11 @@ It illustrates the pattern:
|
|||
|
||||
import asyncio
|
||||
|
||||
from mcp_types import TextContent
|
||||
|
||||
from fastmcp import FastMCP
|
||||
from fastmcp.client import Client
|
||||
from fastmcp.server import create_proxy
|
||||
from fastmcp.types import TextContent
|
||||
|
||||
|
||||
class EchoService:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from mcp_types import ToolAnnotations
|
||||
from phue import Bridge
|
||||
|
||||
from fastmcp import FastMCP
|
||||
from fastmcp.types import ToolAnnotations
|
||||
from smart_home.lights.server import lights_mcp
|
||||
from smart_home.settings import settings
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
|
||||
from typing import Annotated, Any, Literal, TypedDict
|
||||
|
||||
from mcp_types import ToolAnnotations
|
||||
from phue.exceptions import PhueException
|
||||
from pydantic import Field
|
||||
from typing_extensions import NotRequired
|
||||
|
||||
from fastmcp import FastMCP
|
||||
from fastmcp.types import ToolAnnotations
|
||||
from smart_home.lights.hue_utils import _get_bridge, handle_phue_error
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,10 +22,11 @@ Requires the `docket` extra (included in dev dependencies).
|
|||
import asyncio
|
||||
from dataclasses import dataclass
|
||||
|
||||
from mcp_types import TextContent
|
||||
|
||||
from fastmcp import Context, FastMCP
|
||||
from fastmcp.client import Client
|
||||
from fastmcp.server.elicitation import AcceptedElicitation
|
||||
from fastmcp.types import TextContent
|
||||
|
||||
mcp = FastMCP("Task Elicitation Demo")
|
||||
|
||||
|
|
|
|||
|
|
@ -21,11 +21,10 @@ from pathlib import Path
|
|||
from typing import Annotated
|
||||
|
||||
import cyclopts
|
||||
from mcp_types import GetTaskResult
|
||||
from mcp_types import GetTaskResult, TextContent
|
||||
from rich.console import Console
|
||||
|
||||
from fastmcp.client import Client
|
||||
from fastmcp.types import TextContent
|
||||
|
||||
console = Console()
|
||||
app = cyclopts.App(name="tasks-client", help="FastMCP Tasks Example Client")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue