agent-workflow-mcp-server 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.
- agent_workflow_mcp_server-0.1.0/.gitignore +8 -0
- agent_workflow_mcp_server-0.1.0/PKG-INFO +46 -0
- agent_workflow_mcp_server-0.1.0/README.md +32 -0
- agent_workflow_mcp_server-0.1.0/pyproject.toml +21 -0
- agent_workflow_mcp_server-0.1.0/src/__init__.py +0 -0
- agent_workflow_mcp_server-0.1.0/src/db.py +146 -0
- agent_workflow_mcp_server-0.1.0/src/server.py +16 -0
- agent_workflow_mcp_server-0.1.0/src/tools/__init__.py +0 -0
- agent_workflow_mcp_server-0.1.0/src/tools/workflows.py +74 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-workflow-mcp-server
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Reusable workflow templates for AI agents — share, discover and execute multi-step agent workflows
|
|
5
|
+
Project-URL: Homepage, https://github.com/AiAgentKarl/agent-workflow-mcp-server
|
|
6
|
+
Project-URL: Repository, https://github.com/AiAgentKarl/agent-workflow-mcp-server
|
|
7
|
+
Author: AiAgentKarl
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: ai-agents,automation,mcp,orchestration,templates,workflow
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Requires-Dist: mcp>=1.0.0
|
|
12
|
+
Requires-Dist: pydantic>=2.0.0
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# Agent Workflow MCP Server 🔄
|
|
16
|
+
|
|
17
|
+
Reusable workflow templates for AI agents. Like recipes for agent tasks — create, share, discover and execute multi-step workflows.
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
- **Create Workflows** — Define step-by-step templates for common tasks
|
|
22
|
+
- **Share & Discover** — Search for workflows by category or keyword
|
|
23
|
+
- **Ratings** — Community-driven quality signals
|
|
24
|
+
- **Required Tools** — Each workflow lists which MCP tools are needed
|
|
25
|
+
- **Usage Tracking** — See which workflows are most popular
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install agent-workflow-mcp-server
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Tools
|
|
34
|
+
|
|
35
|
+
| Tool | Description |
|
|
36
|
+
|------|-------------|
|
|
37
|
+
| `create_workflow` | Create a reusable workflow template |
|
|
38
|
+
| `get_workflow` | Get and execute a workflow |
|
|
39
|
+
| `search_workflows` | Search by keyword/category |
|
|
40
|
+
| `rate_workflow` | Rate a workflow (1-5) |
|
|
41
|
+
| `popular_workflows` | Most used workflows |
|
|
42
|
+
| `workflow_categories` | List categories |
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
MIT
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Agent Workflow MCP Server 🔄
|
|
2
|
+
|
|
3
|
+
Reusable workflow templates for AI agents. Like recipes for agent tasks — create, share, discover and execute multi-step workflows.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Create Workflows** — Define step-by-step templates for common tasks
|
|
8
|
+
- **Share & Discover** — Search for workflows by category or keyword
|
|
9
|
+
- **Ratings** — Community-driven quality signals
|
|
10
|
+
- **Required Tools** — Each workflow lists which MCP tools are needed
|
|
11
|
+
- **Usage Tracking** — See which workflows are most popular
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install agent-workflow-mcp-server
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Tools
|
|
20
|
+
|
|
21
|
+
| Tool | Description |
|
|
22
|
+
|------|-------------|
|
|
23
|
+
| `create_workflow` | Create a reusable workflow template |
|
|
24
|
+
| `get_workflow` | Get and execute a workflow |
|
|
25
|
+
| `search_workflows` | Search by keyword/category |
|
|
26
|
+
| `rate_workflow` | Rate a workflow (1-5) |
|
|
27
|
+
| `popular_workflows` | Most used workflows |
|
|
28
|
+
| `workflow_categories` | List categories |
|
|
29
|
+
|
|
30
|
+
## License
|
|
31
|
+
|
|
32
|
+
MIT
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "agent-workflow-mcp-server"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Reusable workflow templates for AI agents — share, discover and execute multi-step agent workflows"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [{name = "AiAgentKarl"}]
|
|
13
|
+
keywords = ["mcp", "workflow", "templates", "ai-agents", "automation", "orchestration"]
|
|
14
|
+
dependencies = ["mcp>=1.0.0", "pydantic>=2.0.0"]
|
|
15
|
+
|
|
16
|
+
[project.urls]
|
|
17
|
+
Homepage = "https://github.com/AiAgentKarl/agent-workflow-mcp-server"
|
|
18
|
+
Repository = "https://github.com/AiAgentKarl/agent-workflow-mcp-server"
|
|
19
|
+
|
|
20
|
+
[tool.hatch.build.targets.wheel]
|
|
21
|
+
packages = ["src"]
|
|
File without changes
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"""Datenbank — SQLite-basierte Workflow-Template-Verwaltung."""
|
|
2
|
+
|
|
3
|
+
import sqlite3
|
|
4
|
+
import json
|
|
5
|
+
import os
|
|
6
|
+
from datetime import datetime, timezone
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
_DB_PATH = os.getenv("WORKFLOW_DB_PATH", str(Path(__file__).resolve().parent.parent / "workflows.db"))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _connect() -> sqlite3.Connection:
|
|
13
|
+
conn = sqlite3.connect(_DB_PATH)
|
|
14
|
+
conn.row_factory = sqlite3.Row
|
|
15
|
+
conn.execute("PRAGMA journal_mode=WAL")
|
|
16
|
+
conn.execute("""
|
|
17
|
+
CREATE TABLE IF NOT EXISTS workflows (
|
|
18
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
19
|
+
name TEXT UNIQUE NOT NULL,
|
|
20
|
+
description TEXT NOT NULL,
|
|
21
|
+
category TEXT NOT NULL,
|
|
22
|
+
steps TEXT NOT NULL,
|
|
23
|
+
required_tools TEXT,
|
|
24
|
+
input_schema TEXT,
|
|
25
|
+
output_schema TEXT,
|
|
26
|
+
author TEXT,
|
|
27
|
+
tags TEXT,
|
|
28
|
+
uses INTEGER DEFAULT 0,
|
|
29
|
+
avg_rating REAL DEFAULT 0,
|
|
30
|
+
total_ratings INTEGER DEFAULT 0,
|
|
31
|
+
created_at TEXT NOT NULL,
|
|
32
|
+
updated_at TEXT NOT NULL
|
|
33
|
+
)
|
|
34
|
+
""")
|
|
35
|
+
conn.execute("""
|
|
36
|
+
CREATE TABLE IF NOT EXISTS workflow_ratings (
|
|
37
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
38
|
+
workflow_name TEXT NOT NULL,
|
|
39
|
+
rating INTEGER NOT NULL CHECK(rating BETWEEN 1 AND 5),
|
|
40
|
+
review TEXT,
|
|
41
|
+
created_at TEXT NOT NULL
|
|
42
|
+
)
|
|
43
|
+
""")
|
|
44
|
+
conn.commit()
|
|
45
|
+
return conn
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def create_workflow(
|
|
49
|
+
name: str, description: str, category: str, steps: list[dict],
|
|
50
|
+
required_tools: list[str] = None, input_schema: dict = None,
|
|
51
|
+
output_schema: dict = None, author: str = None, tags: list[str] = None,
|
|
52
|
+
) -> dict:
|
|
53
|
+
conn = _connect()
|
|
54
|
+
now = datetime.now(timezone.utc).isoformat()
|
|
55
|
+
conn.execute(
|
|
56
|
+
"""INSERT INTO workflows (name, description, category, steps,
|
|
57
|
+
required_tools, input_schema, output_schema, author, tags,
|
|
58
|
+
created_at, updated_at)
|
|
59
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
60
|
+
ON CONFLICT(name) DO UPDATE SET
|
|
61
|
+
description=excluded.description, steps=excluded.steps,
|
|
62
|
+
required_tools=excluded.required_tools, updated_at=excluded.updated_at""",
|
|
63
|
+
(name, description, category, json.dumps(steps),
|
|
64
|
+
json.dumps(required_tools) if required_tools else None,
|
|
65
|
+
json.dumps(input_schema) if input_schema else None,
|
|
66
|
+
json.dumps(output_schema) if output_schema else None,
|
|
67
|
+
author, json.dumps(tags) if tags else None, now, now),
|
|
68
|
+
)
|
|
69
|
+
conn.commit()
|
|
70
|
+
conn.close()
|
|
71
|
+
return {"name": name, "created": True}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def get_workflow(name: str) -> dict | None:
|
|
75
|
+
conn = _connect()
|
|
76
|
+
conn.execute("UPDATE workflows SET uses = uses + 1 WHERE name=?", (name,))
|
|
77
|
+
conn.commit()
|
|
78
|
+
row = conn.execute("SELECT * FROM workflows WHERE name=?", (name,)).fetchone()
|
|
79
|
+
conn.close()
|
|
80
|
+
if not row:
|
|
81
|
+
return None
|
|
82
|
+
d = dict(row)
|
|
83
|
+
for field in ["steps", "required_tools", "input_schema", "output_schema", "tags"]:
|
|
84
|
+
d[field] = json.loads(d[field]) if d[field] else None
|
|
85
|
+
return d
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def search_workflows(query: str = None, category: str = None, limit: int = 20) -> list:
|
|
89
|
+
conn = _connect()
|
|
90
|
+
sql = "SELECT * FROM workflows WHERE 1=1"
|
|
91
|
+
params = []
|
|
92
|
+
if query:
|
|
93
|
+
sql += " AND (name LIKE ? OR description LIKE ? OR tags LIKE ?)"
|
|
94
|
+
params.extend([f"%{query}%"] * 3)
|
|
95
|
+
if category:
|
|
96
|
+
sql += " AND category=?"
|
|
97
|
+
params.append(category)
|
|
98
|
+
sql += " ORDER BY uses DESC LIMIT ?"
|
|
99
|
+
params.append(limit)
|
|
100
|
+
rows = conn.execute(sql, params).fetchall()
|
|
101
|
+
conn.close()
|
|
102
|
+
results = []
|
|
103
|
+
for r in rows:
|
|
104
|
+
d = dict(r)
|
|
105
|
+
for field in ["steps", "required_tools", "tags"]:
|
|
106
|
+
d[field] = json.loads(d[field]) if d[field] else None
|
|
107
|
+
results.append(d)
|
|
108
|
+
return results
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def rate_workflow(name: str, rating: int, review: str = None) -> dict:
|
|
112
|
+
conn = _connect()
|
|
113
|
+
now = datetime.now(timezone.utc).isoformat()
|
|
114
|
+
conn.execute(
|
|
115
|
+
"INSERT INTO workflow_ratings (workflow_name, rating, review, created_at) VALUES (?, ?, ?, ?)",
|
|
116
|
+
(name, rating, review, now),
|
|
117
|
+
)
|
|
118
|
+
avg = conn.execute(
|
|
119
|
+
"SELECT AVG(rating) as a, COUNT(*) as c FROM workflow_ratings WHERE workflow_name=?", (name,)
|
|
120
|
+
).fetchone()
|
|
121
|
+
conn.execute(
|
|
122
|
+
"UPDATE workflows SET avg_rating=?, total_ratings=? WHERE name=?",
|
|
123
|
+
(round(avg["a"], 2), avg["c"], name),
|
|
124
|
+
)
|
|
125
|
+
conn.commit()
|
|
126
|
+
conn.close()
|
|
127
|
+
return {"workflow": name, "rating": rating, "new_avg": round(avg["a"], 2)}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def list_categories() -> list:
|
|
131
|
+
conn = _connect()
|
|
132
|
+
rows = conn.execute(
|
|
133
|
+
"SELECT category, COUNT(*) as count FROM workflows GROUP BY category ORDER BY count DESC"
|
|
134
|
+
).fetchall()
|
|
135
|
+
conn.close()
|
|
136
|
+
return [dict(r) for r in rows]
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def get_popular(limit: int = 10) -> list:
|
|
140
|
+
conn = _connect()
|
|
141
|
+
rows = conn.execute(
|
|
142
|
+
"SELECT name, category, description, uses, avg_rating FROM workflows ORDER BY uses DESC LIMIT ?",
|
|
143
|
+
(limit,),
|
|
144
|
+
).fetchall()
|
|
145
|
+
conn.close()
|
|
146
|
+
return [dict(r) for r in rows]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Agent Workflow MCP Server — Wiederverwendbare Workflows für AI-Agents."""
|
|
2
|
+
|
|
3
|
+
from mcp.server.fastmcp import FastMCP
|
|
4
|
+
from src.tools.workflows import register_workflow_tools
|
|
5
|
+
|
|
6
|
+
mcp = FastMCP(
|
|
7
|
+
"Agent Workflows",
|
|
8
|
+
instructions="Reusable workflow templates for AI agents. Create, share, discover and rate multi-step workflows. Like recipes for agent tasks.",
|
|
9
|
+
)
|
|
10
|
+
register_workflow_tools(mcp)
|
|
11
|
+
|
|
12
|
+
def main():
|
|
13
|
+
mcp.run(transport="stdio")
|
|
14
|
+
|
|
15
|
+
if __name__ == "__main__":
|
|
16
|
+
main()
|
|
File without changes
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""Workflow-Tools — Wiederverwendbare Arbeitsabläufe für AI-Agents."""
|
|
2
|
+
|
|
3
|
+
from mcp.server.fastmcp import FastMCP
|
|
4
|
+
from src import db
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def register_workflow_tools(mcp: FastMCP):
|
|
8
|
+
|
|
9
|
+
@mcp.tool()
|
|
10
|
+
async def create_workflow(
|
|
11
|
+
name: str, description: str, category: str, steps: list[dict],
|
|
12
|
+
required_tools: list[str] = None, author: str = None, tags: list[str] = None,
|
|
13
|
+
) -> dict:
|
|
14
|
+
"""Einen Workflow-Template erstellen und teilen.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
name: Eindeutiger Workflow-Name
|
|
18
|
+
description: Was der Workflow macht
|
|
19
|
+
category: Kategorie (z.B. "research", "analysis", "due-diligence")
|
|
20
|
+
steps: Liste von Schritten [{\"step\": 1, \"action\": \"...\", \"tool\": \"...\"}]
|
|
21
|
+
required_tools: Welche MCP-Tools werden benötigt
|
|
22
|
+
author: Autor des Workflows
|
|
23
|
+
tags: Tags für bessere Auffindbarkeit
|
|
24
|
+
"""
|
|
25
|
+
return db.create_workflow(name, description, category, steps, required_tools, author=author, tags=tags)
|
|
26
|
+
|
|
27
|
+
@mcp.tool()
|
|
28
|
+
async def get_workflow(name: str) -> dict:
|
|
29
|
+
"""Einen Workflow-Template abrufen und ausführen.
|
|
30
|
+
|
|
31
|
+
Args:
|
|
32
|
+
name: Name des Workflows
|
|
33
|
+
"""
|
|
34
|
+
result = db.get_workflow(name)
|
|
35
|
+
if result:
|
|
36
|
+
return result
|
|
37
|
+
return {"found": False, "name": name}
|
|
38
|
+
|
|
39
|
+
@mcp.tool()
|
|
40
|
+
async def search_workflows(query: str = None, category: str = None, limit: int = 10) -> dict:
|
|
41
|
+
"""Workflows suchen.
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
query: Suchbegriff
|
|
45
|
+
category: Kategorie-Filter
|
|
46
|
+
limit: Maximale Ergebnisse
|
|
47
|
+
"""
|
|
48
|
+
results = db.search_workflows(query, category, limit)
|
|
49
|
+
return {"results_count": len(results), "workflows": results}
|
|
50
|
+
|
|
51
|
+
@mcp.tool()
|
|
52
|
+
async def rate_workflow(name: str, rating: int, review: str = None) -> dict:
|
|
53
|
+
"""Workflow bewerten (1-5 Sterne).
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
name: Workflow-Name
|
|
57
|
+
rating: 1-5 Sterne
|
|
58
|
+
review: Optionaler Text
|
|
59
|
+
"""
|
|
60
|
+
return db.rate_workflow(name, rating, review)
|
|
61
|
+
|
|
62
|
+
@mcp.tool()
|
|
63
|
+
async def popular_workflows(limit: int = 10) -> dict:
|
|
64
|
+
"""Beliebteste Workflows anzeigen.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
limit: Anzahl
|
|
68
|
+
"""
|
|
69
|
+
return {"popular": db.get_popular(limit)}
|
|
70
|
+
|
|
71
|
+
@mcp.tool()
|
|
72
|
+
async def workflow_categories() -> dict:
|
|
73
|
+
"""Alle Workflow-Kategorien auflisten."""
|
|
74
|
+
return {"categories": db.list_categories()}
|