Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
httpx2==2.9.1
mcp==1.28.1
mcp==2.0.0
mypy==2.3.0
pytest==9.1.1
ruff==0.16.0
Expand Down
10 changes: 5 additions & 5 deletions ai/slackbot-mcp-client/rich-responses/mcp-apps/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import random
from pathlib import Path

from mcp.server.fastmcp import FastMCP
from mcp.server import MCPServer
from mcp.types import CallToolResult, TextContent, ToolAnnotations
from slack_bolt import App
from slack_bolt.adapter.starlette import SlackRequestHandler
Expand All @@ -23,14 +23,14 @@
https://github.com/modelcontextprotocol/python-sdk#quickstart
"""

mcp_server = FastMCP("Dice Game", stateless_http=True, json_response=True)
mcp_server = MCPServer("Dice Game")


@mcp_server.tool(
name="roll_dice",
title="Roll Dice",
description="Roll one or more dice with a configurable number of sides.",
annotations=ToolAnnotations(readOnlyHint=True),
annotations=ToolAnnotations(read_only_hint=True),
meta={
"ui": {
"resourceUri": RESOURCE_URI,
Expand All @@ -47,7 +47,7 @@ def roll_dice(sides: int = 6, count: int = 1) -> CallToolResult:
content=[
TextContent(type="text", text=f"Rolled {label}:{rolls_display} = {total}")
],
structuredContent={
structured_content={
"sides": sides,
"count": count,
"rolls": rolls,
Expand Down Expand Up @@ -123,7 +123,7 @@ async def lifespan(a):
yield


mcp_app = mcp_server.streamable_http_app()
mcp_app = mcp_server.streamable_http_app(stateless_http=True, json_response=True)


app = Starlette(
Expand Down