iflow-mcp_alpic-ai-mcp-server-template 0.1.0__py3-none-any.whl

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,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
+ [![Deploy on Alpic](https://assets.alpic.ai/button.svg)](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,6 @@
1
+ main.py,sha256=U6IcGowDECS-x7DQCrJnJPxATsf4loj29UVL4F-9eeM,1150
2
+ iflow_mcp_alpic_ai_mcp_server_template-0.1.0.dist-info/METADATA,sha256=dBZXYFfBpGGHJNrOlzBht4lIRsmqjESKuxKYsxPKBDA,3184
3
+ iflow_mcp_alpic_ai_mcp_server_template-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
4
+ iflow_mcp_alpic_ai_mcp_server_template-0.1.0.dist-info/entry_points.txt,sha256=nOcvY4wm0kmeu0EKfeL-hvkCmExUb3CPoqIsql16X9o,41
5
+ iflow_mcp_alpic_ai_mcp_server_template-0.1.0.dist-info/top_level.txt,sha256=ZAMgPdWghn6xTRBO6Kc3ML1y3ZrZLnjZlqbboKXc_AE,5
6
+ iflow_mcp_alpic_ai_mcp_server_template-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ mcp-server = main:main
main.py ADDED
@@ -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()