Skip to content

Commit c2c47be

Browse files
rholinsheadandrew-lastmile
authored andcommitted
Bump version to 0.2.2 for publish (lastmile-ai#588)
1 parent 2ad07f5 commit c2c47be

File tree

14 files changed

+97
-69
lines changed

14 files changed

+97
-69
lines changed

examples/mcp_agent_server/temporal/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ async def run(
100100
icon_data_uri = f"data:image/png;base64,{icon_data}"
101101
mag_icon = Icon(src=icon_data_uri, mimeType="image/png", sizes=["64x64"])
102102

103+
103104
@app.tool(
104105
name="finder_tool",
105106
title="Finder Tool",

examples/oauth/protected_by_oauth/main.py

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,39 @@
1010

1111
from mcp_agent.app import MCPApp
1212
from mcp_agent.server.app_server import create_mcp_server_for_app
13-
from mcp_agent.config import Settings, LoggerSettings, \
14-
OAuthTokenStoreSettings, OAuthSettings, MCPAuthorizationServerSettings
13+
from mcp_agent.config import (
14+
Settings,
15+
LoggerSettings,
16+
OAuthTokenStoreSettings,
17+
OAuthSettings,
18+
MCPAuthorizationServerSettings,
19+
)
1520

1621

17-
auth_server = "https://auth.mcp-agent.com" # the MCP Agent Cloud auth server, or replace with your own
22+
auth_server = "https://auth.mcp-agent.com" # the MCP Agent Cloud auth server, or replace with your own
1823
resource_server = "http://localhost:8000" # This server's URL
1924

2025
client_id = "<client id from registration.py>"
2126
client_secret = "<client secret from registration.py>"
2227

2328
settings = Settings(
24-
execution_engine="asyncio",
25-
logger=LoggerSettings(level="info"),
26-
authorization=MCPAuthorizationServerSettings(
27-
enabled=True,
28-
issuer_url=AnyHttpUrl(auth_server),
29-
resource_server_url=AnyHttpUrl(resource_server),
30-
client_id=client_id,
31-
client_secret=client_secret,
32-
required_scopes=["mcp"],
33-
expected_audiences=[client_id],
34-
),
35-
oauth=OAuthSettings(
36-
callback_base_url=AnyHttpUrl(resource_server),
37-
flow_timeout_seconds=300,
38-
token_store=OAuthTokenStoreSettings(refresh_leeway_seconds=60),
39-
)
40-
)
29+
execution_engine="asyncio",
30+
logger=LoggerSettings(level="info"),
31+
authorization=MCPAuthorizationServerSettings(
32+
enabled=True,
33+
issuer_url=AnyHttpUrl(auth_server),
34+
resource_server_url=AnyHttpUrl(resource_server),
35+
client_id=client_id,
36+
client_secret=client_secret,
37+
required_scopes=["mcp"],
38+
expected_audiences=[client_id],
39+
),
40+
oauth=OAuthSettings(
41+
callback_base_url=AnyHttpUrl(resource_server),
42+
flow_timeout_seconds=300,
43+
token_store=OAuthTokenStoreSettings(refresh_leeway_seconds=60),
44+
),
45+
)
4146

4247

4348
# Define the MCPApp instance. The server created for this app will advertise the
@@ -66,6 +71,7 @@ async def hello(app_ctx: Optional[AppContext] = None) -> str:
6671
else:
6772
return "Hello, anonymous user!"
6873

74+
6975
async def main():
7076
async with app.run() as agent_app:
7177
# Log registered workflows and agent configurations

examples/oauth/protected_by_oauth/registration.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
redirect_uris = [
88
# These are the redirect URIs for MCP Inspector. Replace with your app's URIs.
99
"http://localhost:6274/oauth/callback",
10-
"http://localhost:6274/oauth/callback/debug"
10+
"http://localhost:6274/oauth/callback/debug",
1111
]
1212
client_name = "My Python Application"
1313

@@ -28,13 +28,10 @@
2828
registration_request = {
2929
"client_name": client_name,
3030
"redirect_uris": redirect_uris,
31-
"grant_types": [
32-
"authorization_code",
33-
"refresh_token"
34-
],
31+
"grant_types": ["authorization_code", "refresh_token"],
3532
"scope": "mcp",
3633
# use client_secret_basic when testing with MCP Inspector
37-
"token_endpoint_auth_method": "client_secret_basic"
34+
"token_endpoint_auth_method": "client_secret_basic",
3835
}
3936

4037
print(f"Registering client at: {registration_endpoint}")
@@ -43,7 +40,7 @@
4340
response = requests.post(
4441
registration_endpoint,
4542
json=registration_request,
46-
headers={"Content-Type": "application/json"}
43+
headers={"Content-Type": "application/json"},
4744
)
4845

4946
if response.status_code in [200, 201]:
@@ -57,4 +54,4 @@
5754
print(f"Client Secret: {client_info['client_secret']}")
5855
else:
5956
print(f"Registration failed with status {response.status_code}")
60-
print(response.text)
57+
print(response.text)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "mcp-agent"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
description = "Build effective agents with Model Context Protocol (MCP) using simple, composable patterns."
55
readme = "README.md"
66
license = { file = "LICENSE" }

src/mcp_agent/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
sizes=["48x48"],
6262
)
6363

64+
6465
class MCPApp:
6566
"""
6667
Main application class that manages global state and can host workflows.

src/mcp_agent/cli/cloud/commands/deploy/wrangler_wrapper.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,15 @@ def wrangler_deploy(
170170
npm_prefix.mkdir(parents=True, exist_ok=True)
171171
env_updates["npm_config_prefix"] = str(npm_prefix)
172172

173-
if os.environ.get("__MCP_DISABLE_TLS_VALIDATION", "").lower() in ("1", "true", "yes"):
174-
if deployment_settings.DEPLOYMENTS_UPLOAD_API_BASE_URL == DEFAULT_DEPLOYMENTS_UPLOAD_API_BASE_URL:
173+
if os.environ.get("__MCP_DISABLE_TLS_VALIDATION", "").lower() in (
174+
"1",
175+
"true",
176+
"yes",
177+
):
178+
if (
179+
deployment_settings.DEPLOYMENTS_UPLOAD_API_BASE_URL
180+
== DEFAULT_DEPLOYMENTS_UPLOAD_API_BASE_URL
181+
):
175182
print_error(
176183
f"Cannot disable TLS validation when using {DEFAULT_DEPLOYMENTS_UPLOAD_API_BASE_URL}. "
177184
"Set MCP_DEPLOYMENTS_UPLOAD_API_BASE_URL to a custom endpoint."

src/mcp_agent/cli/commands/install.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
print_success,
5050
)
5151

52+
5253
def _get_claude_desktop_config_path() -> Path:
5354
"""Get the Claude Desktop config path based on platform."""
5455
if platform.system() == "Darwin": # macOS

src/mcp_agent/cli/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@ def main(
142142

143143

144144
# Mount non-cloud command groups (top-level, curated)
145-
app.add_typer(init_cmd.app, name="init", help="Scaffold a new mcp-agent project or copy curated examples")
145+
app.add_typer(
146+
init_cmd.app,
147+
name="init",
148+
help="Scaffold a new mcp-agent project or copy curated examples",
149+
)
146150
app.add_typer(config_cmd.app, name="config", help="Manage and inspect configuration")
147151
app.add_typer(doctor_cmd.app, name="doctor", help="Comprehensive diagnostics")
148152

src/mcp_agent/server/app_server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
MCPAgentServer - Exposes MCPApp as MCP server, and
33
mcp-agent workflows and agents as MCP tools.
44
"""
5+
56
from __future__ import annotations
67

78
import json

src/mcp_agent/server/token_verifier.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,14 @@ async def _ensure_introspection_endpoint(self) -> str:
5454
)
5555

5656
parsed_url = URL(str(self._settings.issuer_url))
57-
metadata_url = str(parsed_url.copy_with(path="/.well-known/oauth-authorization-server" \
58-
+ parsed_url.path))
57+
metadata_url = str(
58+
parsed_url.copy_with(
59+
path="/.well-known/oauth-authorization-server" + parsed_url.path
60+
)
61+
)
5962

6063
# Pydantics AnyHttpUrl may add a trailing `/`, remove it
61-
if metadata_url.endswith('/'):
64+
if metadata_url.endswith("/"):
6265
metadata_url = metadata_url[:-1]
6366

6467
metadata = await fetch_authorization_server_metadata(
@@ -118,10 +121,7 @@ async def _introspect(self, token: str) -> MCPAccessToken | None:
118121
data = {"token": token}
119122

120123
auth = None
121-
if (
122-
self._settings.client_id
123-
and self._settings.client_secret
124-
):
124+
if self._settings.client_id and self._settings.client_secret:
125125
auth = httpx.BasicAuth(
126126
self._settings.client_id,
127127
self._settings.client_secret,

0 commit comments

Comments
 (0)