scriptproxymcp 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: scriptproxymcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
Author: Frank Bloecher
|
|
6
|
+
Author-email: Frank Bloecher <frankbloecher@gmail.com>
|
|
7
|
+
Requires-Dist: fastmcp>=3.1.1
|
|
8
|
+
Requires-Dist: mypy>=1.19.1
|
|
9
|
+
Requires-Python: >=3.12
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# ScriptProxyMCP
|
|
13
|
+
|
|
14
|
+
ScriptProxyMCP is a small MCP server that exposes arithmetic tools and a math constants resource using [FastMCP](src/scriptproxymcp/server.py:1).
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- `add(a, b)`
|
|
19
|
+
- `subtract(a, b)`
|
|
20
|
+
- `multiply(a, b)`
|
|
21
|
+
- `divide(a, b)`
|
|
22
|
+
- `math/constant/{name}` resource for `pi`, `e`, and `tau`
|
|
23
|
+
|
|
24
|
+
## Run the server locally
|
|
25
|
+
|
|
26
|
+
The server runs over STDIO by default.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uv run src/scriptproxymcp/server.py
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Use it with MCP Inspector
|
|
33
|
+
|
|
34
|
+
For the MCP Inspector, use the Python/STDIO setup described in the official docs:
|
|
35
|
+
|
|
36
|
+
- Command: `uv`
|
|
37
|
+
- Arguments: `--directory /home/frank/labor/gits/scriptproxymcp run src/scriptproxymcp/server.py`
|
|
38
|
+
|
|
39
|
+
In the Inspector, that maps to the command and arguments fields in the STDIO connection pane.
|
|
40
|
+
|
|
41
|
+
If you launch the Inspector directly from the project directory, the equivalent command is:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx -y @modelcontextprotocol/inspector uv --directory /home/frank/labor/gits/scriptproxymcp run src/scriptproxymcp/server.py
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Development
|
|
48
|
+
|
|
49
|
+
Install dependencies and run checks:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
uv sync
|
|
53
|
+
uv run python -m py_compile src/scriptproxymcp/server.py
|
|
54
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# ScriptProxyMCP
|
|
2
|
+
|
|
3
|
+
ScriptProxyMCP is a small MCP server that exposes arithmetic tools and a math constants resource using [FastMCP](src/scriptproxymcp/server.py:1).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- `add(a, b)`
|
|
8
|
+
- `subtract(a, b)`
|
|
9
|
+
- `multiply(a, b)`
|
|
10
|
+
- `divide(a, b)`
|
|
11
|
+
- `math/constant/{name}` resource for `pi`, `e`, and `tau`
|
|
12
|
+
|
|
13
|
+
## Run the server locally
|
|
14
|
+
|
|
15
|
+
The server runs over STDIO by default.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
uv run src/scriptproxymcp/server.py
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Use it with MCP Inspector
|
|
22
|
+
|
|
23
|
+
For the MCP Inspector, use the Python/STDIO setup described in the official docs:
|
|
24
|
+
|
|
25
|
+
- Command: `uv`
|
|
26
|
+
- Arguments: `--directory /home/frank/labor/gits/scriptproxymcp run src/scriptproxymcp/server.py`
|
|
27
|
+
|
|
28
|
+
In the Inspector, that maps to the command and arguments fields in the STDIO connection pane.
|
|
29
|
+
|
|
30
|
+
If you launch the Inspector directly from the project directory, the equivalent command is:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx -y @modelcontextprotocol/inspector uv --directory /home/frank/labor/gits/scriptproxymcp run src/scriptproxymcp/server.py
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Development
|
|
37
|
+
|
|
38
|
+
Install dependencies and run checks:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
uv sync
|
|
42
|
+
uv run python -m py_compile src/scriptproxymcp/server.py
|
|
43
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "scriptproxymcp"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Add your description here"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Frank Bloecher", email = "frankbloecher@gmail.com" }
|
|
8
|
+
]
|
|
9
|
+
requires-python = ">=3.12"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"fastmcp>=3.1.1",
|
|
12
|
+
"mypy>=1.19.1",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
[build-system]
|
|
16
|
+
requires = ["uv_build>=0.10.12,<0.11.0"]
|
|
17
|
+
build-backend = "uv_build"
|
|
18
|
+
|
|
19
|
+
[dependency-groups]
|
|
20
|
+
dev = [
|
|
21
|
+
"pytest>=9.0.2",
|
|
22
|
+
"ruff>=0.15.7",
|
|
23
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""ScriptProxyMCP arithmetic server."""
|
|
2
|
+
|
|
3
|
+
import math
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
6
|
+
from fastmcp import FastMCP
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
mcp = FastMCP("ScriptProxyMCP")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@mcp.tool()
|
|
13
|
+
def add(a: int, b: int) -> int:
|
|
14
|
+
"""Add two numbers."""
|
|
15
|
+
return a + b
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@mcp.tool()
|
|
19
|
+
def subtract(a: int, b: int) -> int:
|
|
20
|
+
"""Subtract two numbers."""
|
|
21
|
+
return a - b
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@mcp.tool()
|
|
25
|
+
def multiply(a: int, b: int) -> int:
|
|
26
|
+
"""Multiply two numbers."""
|
|
27
|
+
return a * b
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@mcp.tool()
|
|
31
|
+
def divide(a: int, b: int) -> Optional[float]:
|
|
32
|
+
"""Divide two numbers."""
|
|
33
|
+
if b == 0:
|
|
34
|
+
return None
|
|
35
|
+
return a / b
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@mcp.resource("math/constant/{name}")
|
|
39
|
+
def get_constant(name: str) -> Optional[float]:
|
|
40
|
+
"""Get the value of a mathematical constant like 'pi' or 'e'."""
|
|
41
|
+
constants = {
|
|
42
|
+
"pi": math.pi,
|
|
43
|
+
"e": math.e,
|
|
44
|
+
"tau": math.tau,
|
|
45
|
+
}
|
|
46
|
+
return constants.get(name.lower())
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
if __name__ == "__main__":
|
|
50
|
+
mcp.run()
|