Skip to content

Commit 7e1b9d3

Browse files
authored
Merge branch 'main' into main
2 parents 21a775f + 2ea1495 commit 7e1b9d3

File tree

6 files changed

+78
-27
lines changed

6 files changed

+78
-27
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish Docs manually
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
docs-publish:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Configure Git Credentials
14+
run: |
15+
git config user.name github-actions[bot]
16+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v3
20+
with:
21+
enable-cache: true
22+
23+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
24+
- uses: actions/cache@v4
25+
with:
26+
key: mkdocs-material-${{ env.cache_id }}
27+
path: .cache
28+
restore-keys: |
29+
mkdocs-material-
30+
31+
- run: uv sync --frozen --group docs
32+
- run: uv run --no-sync mkdocs gh-deploy --force

.github/workflows/publish-pypi.yml

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ jobs:
1010
runs-on: ubuntu-latest
1111
needs: [checks]
1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v4
1414

15-
- name: Install uv
16-
uses: astral-sh/setup-uv@v3
17-
with:
18-
enable-cache: true
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v3
17+
with:
18+
enable-cache: true
1919

20-
- name: Set up Python 3.12
21-
run: uv python install 3.12
20+
- name: Set up Python 3.12
21+
run: uv python install 3.12
2222

23-
- name: Build
24-
run: uv build
23+
- name: Build
24+
run: uv build
2525

26-
- name: Upload artifacts
27-
uses: actions/upload-artifact@v4
28-
with:
29-
name: release-dists
30-
path: dist/
26+
- name: Upload artifacts
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: release-dists
30+
path: dist/
3131

3232
checks:
3333
uses: ./.github/workflows/shared.yml
@@ -39,17 +39,17 @@ jobs:
3939
needs:
4040
- release-build
4141
permissions:
42-
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
42+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
4343

4444
steps:
45-
- name: Retrieve release distributions
46-
uses: actions/download-artifact@v4
47-
with:
48-
name: release-dists
49-
path: dist/
45+
- name: Retrieve release distributions
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: release-dists
49+
path: dist/
5050

51-
- name: Publish package distributions to PyPI
52-
uses: pypa/gh-action-pypi-publish@release/v1
51+
- name: Publish package distributions to PyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1
5353

5454
docs-publish:
5555
runs-on: ubuntu-latest
@@ -62,16 +62,19 @@ jobs:
6262
run: |
6363
git config user.name github-actions[bot]
6464
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
65-
- name: "Set up Python"
66-
uses: actions/setup-python@v5
65+
66+
- name: Install uv
67+
uses: astral-sh/setup-uv@v3
6768
with:
68-
python-version-file: ".python-version"
69+
enable-cache: true
70+
6971
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
7072
- uses: actions/cache@v4
7173
with:
7274
key: mkdocs-material-${{ env.cache_id }}
7375
path: .cache
7476
restore-keys: |
7577
mkdocs-material-
78+
7679
- run: uv sync --frozen --group docs
7780
- run: uv run --no-sync mkdocs gh-deploy --force
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
GROQ_API_KEY=gsk_1234567890
1+
LLM_API_KEY=gsk_1234567890

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ strict: true
55
repo_name: modelcontextprotocol/python-sdk
66
repo_url: https://github.com/modelcontextprotocol/python-sdk
77
edit_uri: edit/main/docs/
8+
site_url: https://modelcontextprotocol.github.io/python-sdk
89

910
# TODO(Marcelo): Add Anthropic copyright?
1011
# copyright: © Model Context Protocol 2025 to present

src/mcp/server/fastmcp/utilities/func_metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def pre_parse_json(self, data: dict[str, Any]) -> dict[str, Any]:
8888
pre_parsed = json.loads(data[field_name])
8989
except json.JSONDecodeError:
9090
continue # Not JSON - skip
91-
if isinstance(pre_parsed, str):
91+
if isinstance(pre_parsed, str | int | float):
9292
# This is likely that the raw value is e.g. `"hello"` which we
9393
# Should really be parsed as '"hello"' in Python - but if we parse
9494
# it as JSON it'll turn into just 'hello'. So we skip it.

tests/server/fastmcp/test_func_metadata.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,3 +399,18 @@ def test_complex_function_json_schema():
399399
"title": "complex_arguments_fnArguments",
400400
"type": "object",
401401
}
402+
403+
404+
def test_str_vs_int():
405+
"""
406+
Test that string values are kept as strings even when they contain numbers,
407+
while numbers are parsed correctly.
408+
"""
409+
410+
def func_with_str_and_int(a: str, b: int):
411+
return a
412+
413+
meta = func_metadata(func_with_str_and_int)
414+
result = meta.pre_parse_json({"a": "123", "b": 123})
415+
assert result["a"] == "123"
416+
assert result["b"] == 123

0 commit comments

Comments
 (0)