mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 15:19:10 +02:00
Add an init to make mcp_mixin a module
This commit is contained in:
parent
8582099ddd
commit
a49337f02d
4 changed files with 16 additions and 6 deletions
|
|
@ -10,7 +10,7 @@ Inherit from `MCPMixin` and use the decorators on the methods you want to regist
|
|||
|
||||
```python
|
||||
from fastmcp import FastMCP
|
||||
from contrib.mcp_mixin.mcp_mixin import MCPMixin, mcp_tool, mcp_resource
|
||||
from contrib.mcp_mixin import MCPMixin, mcp_tool, mcp_resource
|
||||
|
||||
class MyComponent(MCPMixin):
|
||||
@mcp_tool(name="my_tool", description="Does something cool.")
|
||||
|
|
|
|||
8
src/contrib/mcp_mixin/__init__.py
Normal file
8
src/contrib/mcp_mixin/__init__.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from .mcp_mixin import MCPMixin, mcp_tool, mcp_resource, mcp_prompt
|
||||
|
||||
__all__ = [
|
||||
"MCPMixin",
|
||||
"mcp_tool",
|
||||
"mcp_resource",
|
||||
"mcp_prompt",
|
||||
]
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import asyncio
|
||||
|
||||
from contrib.mcp_mixin.mcp_mixin import (
|
||||
from contrib.mcp_mixin import (
|
||||
MCPMixin,
|
||||
mcp_prompt,
|
||||
mcp_resource,
|
||||
|
|
|
|||
|
|
@ -2,15 +2,17 @@
|
|||
|
||||
import pytest
|
||||
|
||||
from contrib.mcp_mixin.mcp_mixin import (
|
||||
_DEFAULT_SEPARATOR_PROMPT,
|
||||
_DEFAULT_SEPARATOR_RESOURCE,
|
||||
_DEFAULT_SEPARATOR_TOOL,
|
||||
from contrib.mcp_mixin import (
|
||||
MCPMixin,
|
||||
mcp_prompt,
|
||||
mcp_resource,
|
||||
mcp_tool,
|
||||
)
|
||||
from contrib.mcp_mixin.mcp_mixin import (
|
||||
_DEFAULT_SEPARATOR_PROMPT,
|
||||
_DEFAULT_SEPARATOR_RESOURCE,
|
||||
_DEFAULT_SEPARATOR_TOOL,
|
||||
)
|
||||
from fastmcp import FastMCP
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue