iflow-mcp_alpic-ai-mcp-server-template 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.
- iflow_mcp_alpic_ai_mcp_server_template-0.1.0/PKG-INFO +120 -0
- iflow_mcp_alpic_ai_mcp_server_template-0.1.0/README.md +109 -0
- iflow_mcp_alpic_ai_mcp_server_template-0.1.0/iflow_mcp_alpic_ai_mcp_server_template.egg-info/PKG-INFO +120 -0
- iflow_mcp_alpic_ai_mcp_server_template-0.1.0/iflow_mcp_alpic_ai_mcp_server_template.egg-info/SOURCES.txt +9 -0
- iflow_mcp_alpic_ai_mcp_server_template-0.1.0/iflow_mcp_alpic_ai_mcp_server_template.egg-info/dependency_links.txt +1 -0
- iflow_mcp_alpic_ai_mcp_server_template-0.1.0/iflow_mcp_alpic_ai_mcp_server_template.egg-info/entry_points.txt +2 -0
- iflow_mcp_alpic_ai_mcp_server_template-0.1.0/iflow_mcp_alpic_ai_mcp_server_template.egg-info/requires.txt +2 -0
- iflow_mcp_alpic_ai_mcp_server_template-0.1.0/iflow_mcp_alpic_ai_mcp_server_template.egg-info/top_level.txt +1 -0
- iflow_mcp_alpic_ai_mcp_server_template-0.1.0/main.py +53 -0
- iflow_mcp_alpic_ai_mcp_server_template-0.1.0/pyproject.toml +15 -0
- iflow_mcp_alpic_ai_mcp_server_template-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: iflow-mcp_alpic-ai-mcp-server-template
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python MCP Server template
|
|
5
|
+
Author: Alpic
|
|
6
|
+
Keywords: mcp,llm,alpic,python
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: black>=25.1.0
|
|
10
|
+
Requires-Dist: mcp
|
|
11
|
+
|
|
12
|
+
# mcp-server-template-python
|
|
13
|
+
|
|
14
|
+
A very simple Python template for building MCP servers using Streamable HTTP transport.
|
|
15
|
+
|
|
16
|
+
## Overview
|
|
17
|
+
This template provides a foundation for creating MCP servers that can communicate with AI assistants and other MCP clients. It includes a simple HTTP server implementation with example tools, resources & prompts to help you get started building your own MCP integrations.
|
|
18
|
+
|
|
19
|
+
## Deploy
|
|
20
|
+
|
|
21
|
+
Use the following button to clone the repository and directly deploy the server to Alpic
|
|
22
|
+
|
|
23
|
+
[](https://app.alpic.ai/new/clone?repositoryUrl=https%3A%2F%2Fgithub.com%2Falpic-ai%2Fmcp-server-template-python)
|
|
24
|
+
|
|
25
|
+
## Prerequisites
|
|
26
|
+
- Install uv (https://docs.astral.sh/uv/getting-started/installation/)
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
1. Clone the repository:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git clone git@github.com:alpic-ai/mcp-server-template-python.git
|
|
34
|
+
cd mcp-server-template-python
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
2. Install python version & dependencies:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
uv python install
|
|
41
|
+
uv sync --locked
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
Start the server on port 3000:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
uv run main.py
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Running the Inspector
|
|
53
|
+
|
|
54
|
+
### Requirements
|
|
55
|
+
- Node.js: ^22.7.5
|
|
56
|
+
|
|
57
|
+
### Quick Start (UI mode)
|
|
58
|
+
To get up and running right away with the UI, just execute the following:
|
|
59
|
+
```bash
|
|
60
|
+
npx @modelcontextprotocol/inspector
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The inspector server will start up and the UI will be accessible at http://localhost:6274.
|
|
64
|
+
|
|
65
|
+
You can test your server locally by selecting:
|
|
66
|
+
- Transport Type: Streamable HTTP
|
|
67
|
+
- URL: http://127.0.0.1:3000/mcp
|
|
68
|
+
|
|
69
|
+
## Development
|
|
70
|
+
|
|
71
|
+
### Adding New Tools
|
|
72
|
+
|
|
73
|
+
To add a new tool, modify `main.py`:
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
@mcp.tool(
|
|
77
|
+
title="Your Tool Name",
|
|
78
|
+
description="Tool Description for the LLM",
|
|
79
|
+
)
|
|
80
|
+
async def new_tool(
|
|
81
|
+
tool_param1: str = Field(description="The description of the param1 for the LLM"),
|
|
82
|
+
tool_param2: float = Field(description="The description of the param2 for the LLM")
|
|
83
|
+
)-> str:
|
|
84
|
+
"""The new tool underlying method"""
|
|
85
|
+
result = await some_api_call(tool_param1, tool_param2)
|
|
86
|
+
return result
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Adding New Resources
|
|
90
|
+
|
|
91
|
+
To add a new resource, modify `main.py`:
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
@mcp.resource(
|
|
95
|
+
uri="your-scheme://{param1}/{param2}",
|
|
96
|
+
description="Description of what this resource provides",
|
|
97
|
+
name="Your Resource Name",
|
|
98
|
+
)
|
|
99
|
+
def your_resource(param1: str, param2: str) -> str:
|
|
100
|
+
"""The resource template implementation"""
|
|
101
|
+
# Your resource logic here
|
|
102
|
+
return f"Resource content for {param1} and {param2}"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The URI template uses `{param_name}` syntax to define parameters that will be extracted from the resource URI and passed to your function.
|
|
106
|
+
|
|
107
|
+
### Adding New Prompts
|
|
108
|
+
|
|
109
|
+
To add a new prompt , modify `main.py`:
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
@mcp.prompt("")
|
|
113
|
+
async def your_prompt(
|
|
114
|
+
prompt_param: str = Field(description="The description of the param for the user")
|
|
115
|
+
) -> str:
|
|
116
|
+
"""Generate a helpful prompt"""
|
|
117
|
+
|
|
118
|
+
return f"You are a friendly assistant, help the user and don't forget to {prompt_param}."
|
|
119
|
+
|
|
120
|
+
```
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# mcp-server-template-python
|
|
2
|
+
|
|
3
|
+
A very simple Python template for building MCP servers using Streamable HTTP transport.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
This template provides a foundation for creating MCP servers that can communicate with AI assistants and other MCP clients. It includes a simple HTTP server implementation with example tools, resources & prompts to help you get started building your own MCP integrations.
|
|
7
|
+
|
|
8
|
+
## Deploy
|
|
9
|
+
|
|
10
|
+
Use the following button to clone the repository and directly deploy the server to Alpic
|
|
11
|
+
|
|
12
|
+
[](https://app.alpic.ai/new/clone?repositoryUrl=https%3A%2F%2Fgithub.com%2Falpic-ai%2Fmcp-server-template-python)
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
- Install uv (https://docs.astral.sh/uv/getting-started/installation/)
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
1. Clone the repository:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git clone git@github.com:alpic-ai/mcp-server-template-python.git
|
|
23
|
+
cd mcp-server-template-python
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
2. Install python version & dependencies:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uv python install
|
|
30
|
+
uv sync --locked
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
Start the server on port 3000:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
uv run main.py
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Running the Inspector
|
|
42
|
+
|
|
43
|
+
### Requirements
|
|
44
|
+
- Node.js: ^22.7.5
|
|
45
|
+
|
|
46
|
+
### Quick Start (UI mode)
|
|
47
|
+
To get up and running right away with the UI, just execute the following:
|
|
48
|
+
```bash
|
|
49
|
+
npx @modelcontextprotocol/inspector
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The inspector server will start up and the UI will be accessible at http://localhost:6274.
|
|
53
|
+
|
|
54
|
+
You can test your server locally by selecting:
|
|
55
|
+
- Transport Type: Streamable HTTP
|
|
56
|
+
- URL: http://127.0.0.1:3000/mcp
|
|
57
|
+
|
|
58
|
+
## Development
|
|
59
|
+
|
|
60
|
+
### Adding New Tools
|
|
61
|
+
|
|
62
|
+
To add a new tool, modify `main.py`:
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
@mcp.tool(
|
|
66
|
+
title="Your Tool Name",
|
|
67
|
+
description="Tool Description for the LLM",
|
|
68
|
+
)
|
|
69
|
+
async def new_tool(
|
|
70
|
+
tool_param1: str = Field(description="The description of the param1 for the LLM"),
|
|
71
|
+
tool_param2: float = Field(description="The description of the param2 for the LLM")
|
|
72
|
+
)-> str:
|
|
73
|
+
"""The new tool underlying method"""
|
|
74
|
+
result = await some_api_call(tool_param1, tool_param2)
|
|
75
|
+
return result
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Adding New Resources
|
|
79
|
+
|
|
80
|
+
To add a new resource, modify `main.py`:
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
@mcp.resource(
|
|
84
|
+
uri="your-scheme://{param1}/{param2}",
|
|
85
|
+
description="Description of what this resource provides",
|
|
86
|
+
name="Your Resource Name",
|
|
87
|
+
)
|
|
88
|
+
def your_resource(param1: str, param2: str) -> str:
|
|
89
|
+
"""The resource template implementation"""
|
|
90
|
+
# Your resource logic here
|
|
91
|
+
return f"Resource content for {param1} and {param2}"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The URI template uses `{param_name}` syntax to define parameters that will be extracted from the resource URI and passed to your function.
|
|
95
|
+
|
|
96
|
+
### Adding New Prompts
|
|
97
|
+
|
|
98
|
+
To add a new prompt , modify `main.py`:
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
@mcp.prompt("")
|
|
102
|
+
async def your_prompt(
|
|
103
|
+
prompt_param: str = Field(description="The description of the param for the user")
|
|
104
|
+
) -> str:
|
|
105
|
+
"""Generate a helpful prompt"""
|
|
106
|
+
|
|
107
|
+
return f"You are a friendly assistant, help the user and don't forget to {prompt_param}."
|
|
108
|
+
|
|
109
|
+
```
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: iflow-mcp_alpic-ai-mcp-server-template
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python MCP Server template
|
|
5
|
+
Author: Alpic
|
|
6
|
+
Keywords: mcp,llm,alpic,python
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: black>=25.1.0
|
|
10
|
+
Requires-Dist: mcp
|
|
11
|
+
|
|
12
|
+
# mcp-server-template-python
|
|
13
|
+
|
|
14
|
+
A very simple Python template for building MCP servers using Streamable HTTP transport.
|
|
15
|
+
|
|
16
|
+
## Overview
|
|
17
|
+
This template provides a foundation for creating MCP servers that can communicate with AI assistants and other MCP clients. It includes a simple HTTP server implementation with example tools, resources & prompts to help you get started building your own MCP integrations.
|
|
18
|
+
|
|
19
|
+
## Deploy
|
|
20
|
+
|
|
21
|
+
Use the following button to clone the repository and directly deploy the server to Alpic
|
|
22
|
+
|
|
23
|
+
[](https://app.alpic.ai/new/clone?repositoryUrl=https%3A%2F%2Fgithub.com%2Falpic-ai%2Fmcp-server-template-python)
|
|
24
|
+
|
|
25
|
+
## Prerequisites
|
|
26
|
+
- Install uv (https://docs.astral.sh/uv/getting-started/installation/)
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
1. Clone the repository:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git clone git@github.com:alpic-ai/mcp-server-template-python.git
|
|
34
|
+
cd mcp-server-template-python
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
2. Install python version & dependencies:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
uv python install
|
|
41
|
+
uv sync --locked
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
Start the server on port 3000:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
uv run main.py
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Running the Inspector
|
|
53
|
+
|
|
54
|
+
### Requirements
|
|
55
|
+
- Node.js: ^22.7.5
|
|
56
|
+
|
|
57
|
+
### Quick Start (UI mode)
|
|
58
|
+
To get up and running right away with the UI, just execute the following:
|
|
59
|
+
```bash
|
|
60
|
+
npx @modelcontextprotocol/inspector
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The inspector server will start up and the UI will be accessible at http://localhost:6274.
|
|
64
|
+
|
|
65
|
+
You can test your server locally by selecting:
|
|
66
|
+
- Transport Type: Streamable HTTP
|
|
67
|
+
- URL: http://127.0.0.1:3000/mcp
|
|
68
|
+
|
|
69
|
+
## Development
|
|
70
|
+
|
|
71
|
+
### Adding New Tools
|
|
72
|
+
|
|
73
|
+
To add a new tool, modify `main.py`:
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
@mcp.tool(
|
|
77
|
+
title="Your Tool Name",
|
|
78
|
+
description="Tool Description for the LLM",
|
|
79
|
+
)
|
|
80
|
+
async def new_tool(
|
|
81
|
+
tool_param1: str = Field(description="The description of the param1 for the LLM"),
|
|
82
|
+
tool_param2: float = Field(description="The description of the param2 for the LLM")
|
|
83
|
+
)-> str:
|
|
84
|
+
"""The new tool underlying method"""
|
|
85
|
+
result = await some_api_call(tool_param1, tool_param2)
|
|
86
|
+
return result
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Adding New Resources
|
|
90
|
+
|
|
91
|
+
To add a new resource, modify `main.py`:
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
@mcp.resource(
|
|
95
|
+
uri="your-scheme://{param1}/{param2}",
|
|
96
|
+
description="Description of what this resource provides",
|
|
97
|
+
name="Your Resource Name",
|
|
98
|
+
)
|
|
99
|
+
def your_resource(param1: str, param2: str) -> str:
|
|
100
|
+
"""The resource template implementation"""
|
|
101
|
+
# Your resource logic here
|
|
102
|
+
return f"Resource content for {param1} and {param2}"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The URI template uses `{param_name}` syntax to define parameters that will be extracted from the resource URI and passed to your function.
|
|
106
|
+
|
|
107
|
+
### Adding New Prompts
|
|
108
|
+
|
|
109
|
+
To add a new prompt , modify `main.py`:
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
@mcp.prompt("")
|
|
113
|
+
async def your_prompt(
|
|
114
|
+
prompt_param: str = Field(description="The description of the param for the user")
|
|
115
|
+
) -> str:
|
|
116
|
+
"""Generate a helpful prompt"""
|
|
117
|
+
|
|
118
|
+
return f"You are a friendly assistant, help the user and don't forget to {prompt_param}."
|
|
119
|
+
|
|
120
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
main.py
|
|
3
|
+
pyproject.toml
|
|
4
|
+
iflow_mcp_alpic_ai_mcp_server_template.egg-info/PKG-INFO
|
|
5
|
+
iflow_mcp_alpic_ai_mcp_server_template.egg-info/SOURCES.txt
|
|
6
|
+
iflow_mcp_alpic_ai_mcp_server_template.egg-info/dependency_links.txt
|
|
7
|
+
iflow_mcp_alpic_ai_mcp_server_template.egg-info/entry_points.txt
|
|
8
|
+
iflow_mcp_alpic_ai_mcp_server_template.egg-info/requires.txt
|
|
9
|
+
iflow_mcp_alpic_ai_mcp_server_template.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
main
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""
|
|
2
|
+
MCP Server Template
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from mcp.server.fastmcp import FastMCP
|
|
6
|
+
from pydantic import Field
|
|
7
|
+
|
|
8
|
+
import mcp.types as types
|
|
9
|
+
|
|
10
|
+
mcp = FastMCP("Echo Server")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@mcp.tool(
|
|
14
|
+
title="Echo Tool",
|
|
15
|
+
description="Echo the input text",
|
|
16
|
+
)
|
|
17
|
+
def echo(text: str = Field(description="The text to echo")) -> str:
|
|
18
|
+
return text
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@mcp.resource(
|
|
22
|
+
uri="greeting://{name}",
|
|
23
|
+
description="Get a personalized greeting",
|
|
24
|
+
name="Greeting Resource",
|
|
25
|
+
)
|
|
26
|
+
def get_greeting(
|
|
27
|
+
name: str,
|
|
28
|
+
) -> str:
|
|
29
|
+
return f"Hello, {name}!"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@mcp.prompt("")
|
|
33
|
+
def greet_user(
|
|
34
|
+
name: str = Field(description="The name of the person to greet"),
|
|
35
|
+
style: str = Field(description="The style of the greeting", default="friendly"),
|
|
36
|
+
) -> str:
|
|
37
|
+
"""Generate a greeting prompt"""
|
|
38
|
+
styles = {
|
|
39
|
+
"friendly": "Please write a warm, friendly greeting",
|
|
40
|
+
"formal": "Please write a formal, professional greeting",
|
|
41
|
+
"casual": "Please write a casual, relaxed greeting",
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return f"{styles.get(style, styles['friendly'])} for someone named {name}."
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def main():
|
|
48
|
+
"""Main entry point for the MCP server"""
|
|
49
|
+
mcp.run()
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
if __name__ == "__main__":
|
|
53
|
+
main()
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "iflow-mcp_alpic-ai-mcp-server-template"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Python MCP Server template"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
authors = [{ name = "Alpic" }]
|
|
8
|
+
keywords = ["mcp", "llm", "alpic", "python"]
|
|
9
|
+
dependencies = [
|
|
10
|
+
"black>=25.1.0",
|
|
11
|
+
"mcp",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[project.scripts]
|
|
15
|
+
mcp-server = "main:main"
|