sokrates-mcp 0.4.1__py3-none-any.whl → 0.4.2__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.
- sokrates_mcp/main.py +3 -90
- sokrates_mcp/mcp_config.py +1 -4
- sokrates_mcp/workflow.py +18 -0
- {sokrates_mcp-0.4.1.dist-info → sokrates_mcp-0.4.2.dist-info}/METADATA +5 -2
- sokrates_mcp-0.4.2.dist-info/RECORD +13 -0
- sokrates_mcp-0.4.1.dist-info/RECORD +0 -13
- {sokrates_mcp-0.4.1.dist-info → sokrates_mcp-0.4.2.dist-info}/WHEEL +0 -0
- {sokrates_mcp-0.4.1.dist-info → sokrates_mcp-0.4.2.dist-info}/entry_points.txt +0 -0
- {sokrates_mcp-0.4.1.dist-info → sokrates_mcp-0.4.2.dist-info}/licenses/LICENSE +0 -0
- {sokrates_mcp-0.4.1.dist-info → sokrates_mcp-0.4.2.dist-info}/top_level.txt +0 -0
sokrates_mcp/main.py
CHANGED
@@ -9,94 +9,7 @@
|
|
9
9
|
# through various prompt engineering workflows. It provides APIs for refining prompts, executing them externally,
|
10
10
|
# breaking down complex tasks, generating ideas, performing code reviews, and listing available models/providers.
|
11
11
|
#
|
12
|
-
# Parameters
|
13
|
-
# - `refine_prompt`: Refines a given prompt by enriching it with additional context.
|
14
|
-
# - `prompt` (str): The input prompt to be refined.
|
15
|
-
# - `refinement_type` (str, optional): Type of refinement ('code' or 'default'). Default is 'default'.
|
16
|
-
# - `provider` (str, optional): Name of the provider to use for refinement. Default is 'default'.
|
17
|
-
# - `model` (str, optional): Model name for refinement. Default is 'default'.
|
18
12
|
#
|
19
|
-
# - `refine_and_execute_external_prompt`: Refines a prompt and executes it with an external LLM.
|
20
|
-
# - `prompt` (str): The input prompt to be refined and executed.
|
21
|
-
# - `provider` (str, optional): Name of the provider to use for LLM interactions. Default is 'default'.
|
22
|
-
# - `refinement_model` (str, optional): Model for refinement. Default is 'default'.
|
23
|
-
# - `execution_model` (str, optional): Model for execution. Default is 'default'.
|
24
|
-
# - `refinement_type` (str, optional): Type of refinement ('code' or 'default'). Default is 'default'.
|
25
|
-
#
|
26
|
-
# - `handover_prompt`: Hands over a prompt to an external LLM for processing.
|
27
|
-
# - `prompt` (str): The prompt to be executed externally.
|
28
|
-
# - `provider` (str, optional): Name of the provider to use for LLM interactions. Default is 'default'.
|
29
|
-
# - `model` (str, optional): Model name for execution. Default is 'default'.
|
30
|
-
# - `temperature` (float, optional): Temperature for the external execution. Default is 0.7.
|
31
|
-
#
|
32
|
-
# - `breakdown_task`: Breaks down a task into sub-tasks with complexity ratings.
|
33
|
-
# - `task` (str): The full task description to break down.
|
34
|
-
# - `provider` (str, optional): Name of the provider to use for LLM interactions. Default is 'default'.
|
35
|
-
# - `model` (str, optional): Model name for processing. Default is 'default'.
|
36
|
-
#
|
37
|
-
# - `generate_random_ideas`: Generates random ideas on a random topic.
|
38
|
-
# - `idea_count` (int, optional): Number of ideas to generate. Default is 1.
|
39
|
-
# - `provider` (str, optional): Name of the provider to use for LLM interactions. Default is 'default'.
|
40
|
-
# - `model` (str, optional): Model name for generation. Default is 'default'.
|
41
|
-
# - `temperature` (float, optional): Temperature for idea generation. Default is 0.7.
|
42
|
-
#
|
43
|
-
# - `generate_ideas_on_topic`: Generates ideas on a specific topic.
|
44
|
-
# - `topic` (str): The topic to generate ideas for.
|
45
|
-
# - `provider` (str, optional): Name of the provider to use for LLM interactions. Default is 'default'.
|
46
|
-
# - `model` (str, optional): Model name for generation. Default is 'default'.
|
47
|
-
# - `idea_count` (int, optional): Number of ideas to generate. Default is 1.
|
48
|
-
# - `temperature` (float, optional): Temperature for idea generation. Default is 0.7.
|
49
|
-
#
|
50
|
-
# - `generate_code_review`: Generates a code review in markdown format.
|
51
|
-
# - `source_file_paths` (list): List of source file paths to be reviewed.
|
52
|
-
# - `target_directory` (str): Directory to store the resulting review files.
|
53
|
-
# - `provider` (str, optional): Name of the provider to use for LLM interactions. Default is 'default'.
|
54
|
-
# - `model` (str, optional): Model name for code review generation. Default is 'default'.
|
55
|
-
# - `review_type` (str, optional): Type of review ('style', 'security', 'performance', 'quality'). Default is 'quality'.
|
56
|
-
#
|
57
|
-
# - `list_available_models_for_provider`: Lists all available large language models for a specific provider.
|
58
|
-
# - `provider_name` (str, optional): Name of the provider to list models for. Default is empty (uses default).
|
59
|
-
#
|
60
|
-
# - `list_available_providers`: Lists all configured and available API providers.
|
61
|
-
#
|
62
|
-
# Usage Examples
|
63
|
-
# ```python
|
64
|
-
# Refine a prompt
|
65
|
-
# await refine_prompt("Write a Python function to sort a list", refinement_type="code")
|
66
|
-
#
|
67
|
-
# # Refine and execute a prompt with an external LLM
|
68
|
-
# await refine_and_execute_external_prompt(
|
69
|
-
# "Generate a summary of the following text: ...",
|
70
|
-
# refinement_model="model1",
|
71
|
-
# execution_model="model2"
|
72
|
-
# )
|
73
|
-
#
|
74
|
-
# # Hand over a prompt to an external LLM
|
75
|
-
# await handover_prompt("Translate this text to French: ...")
|
76
|
-
#
|
77
|
-
# # Break down a task into sub-tasks
|
78
|
-
# await breakdown_task("Implement user authentication system")
|
79
|
-
#
|
80
|
-
# # Generate random ideas
|
81
|
-
# await generate_random_ideas(idea_count=3)
|
82
|
-
#
|
83
|
-
# # Generate ideas on a topic
|
84
|
-
# await generate_ideas_on_topic("AI in healthcare", idea_count=5)
|
85
|
-
#
|
86
|
-
# # Generate code review
|
87
|
-
# await generate_code_review(
|
88
|
-
# source_file_paths=["/path/to/file1.py", "/path/to/file2.py"],
|
89
|
-
# target_directory="/path/to/reviews"
|
90
|
-
# )
|
91
|
-
#
|
92
|
-
# # List available models for a provider
|
93
|
-
# await list_available_models_for_provider("my-provider")
|
94
|
-
#
|
95
|
-
# # List all available providers
|
96
|
-
# await list_available_providers()
|
97
|
-
# ```
|
98
|
-
#
|
99
|
-
|
100
13
|
from typing import Annotated, Optional
|
101
14
|
from pydantic import Field
|
102
15
|
from .mcp_config import MCPConfig
|
@@ -107,7 +20,7 @@ import os
|
|
107
20
|
import argparse
|
108
21
|
|
109
22
|
MCP_NAME = "sokrates-mcp"
|
110
|
-
VERSION = "0.2
|
23
|
+
VERSION = "0.4.2"
|
111
24
|
DEFAULT_PROVIDER_IDENTIFIER = "default"
|
112
25
|
DEFAULT_MODEL_IDENTIFIER = "default"
|
113
26
|
DEFAULT_REFINEMENT_TYPE = "default"
|
@@ -252,7 +165,7 @@ async def breakdown_task(task: Annotated[str, Field(description="The full task d
|
|
252
165
|
|
253
166
|
@mcp.tool(
|
254
167
|
name="generate_random_ideas",
|
255
|
-
description="Invents and generates a random topic
|
168
|
+
description="Invents and generates a random topic and generates the provided count of ideas on the topic.",
|
256
169
|
tags={"idea", "generator","invention","random"}
|
257
170
|
)
|
258
171
|
async def generate_random_ideas(ctx: Context,
|
@@ -286,7 +199,7 @@ async def generate_ideas_on_topic(
|
|
286
199
|
async def generate_code_review(
|
287
200
|
ctx: Context,
|
288
201
|
source_directory: Annotated[str, Field(description="The absolute directory path containing source files to create reviews for. This should contain source files on the local filesystem.")],
|
289
|
-
source_file_paths: Annotated[list, Field(description="A list of absolute source file paths that should be reviewed. The paths should be absolute paths in the local filesystem.")],
|
202
|
+
source_file_paths: Annotated[list[str], Field(description="A list of absolute source file paths that should be reviewed. The paths should be absolute paths in the local filesystem.")],
|
290
203
|
target_directory: Annotated[str, Field(description="The directory to store the resulting review markdown files. This should point to the desired target path for the markdown files on the local filesystem.")],
|
291
204
|
provider: Annotated[str, Field(description="The name of the provider to use for LLM interactions. The default model name is 'default', which will pick the server's default provider configured.", default=DEFAULT_PROVIDER_IDENTIFIER)],
|
292
205
|
model: Annotated[str, Field(description="[Optional] The name of the model that should be used for the generation. The default model name is 'default', which will pick the server's default model.", default=DEFAULT_MODEL_IDENTIFIER)],
|
sokrates_mcp/mcp_config.py
CHANGED
@@ -8,7 +8,6 @@
|
|
8
8
|
# - api_endpoint: API endpoint URL (default: http://localhost:1234/v1)
|
9
9
|
# - api_key: API key for authentication (default: mykey)
|
10
10
|
# - model: Model name to use (default: qwen/qwen3-4b-2507)
|
11
|
-
# - verbose: Enable verbose logging (default: False)
|
12
11
|
#
|
13
12
|
# Usage example:
|
14
13
|
# config = MCPConfig(api_endpoint="https://api.example.com", model="my-model")
|
@@ -54,7 +53,7 @@ class MCPConfig:
|
|
54
53
|
"openai"
|
55
54
|
]
|
56
55
|
|
57
|
-
def __init__(self, config_file_path: str = CONFIG_FILE_PATH, api_endpoint: str = DEFAULT_API_ENDPOINT, api_key: str = DEFAULT_API_KEY, model: str = DEFAULT_MODEL
|
56
|
+
def __init__(self, config_file_path: str = CONFIG_FILE_PATH, api_endpoint: str = DEFAULT_API_ENDPOINT, api_key: str = DEFAULT_API_KEY, model: str = DEFAULT_MODEL):
|
58
57
|
"""Initialize MCP configuration.
|
59
58
|
|
60
59
|
Args:
|
@@ -63,11 +62,9 @@ class MCPConfig:
|
|
63
62
|
api_endpoint (str): API endpoint URL. Defaults to DEFAULT_API_ENDPOINT.
|
64
63
|
api_key (str): API key for authentication. Defaults to DEFAULT_API_KEY.
|
65
64
|
model (str): Model name to use. Defaults to DEFAULT_MODEL.
|
66
|
-
verbose (bool): Enable verbose logging. Defaults to False.
|
67
65
|
|
68
66
|
Side Effects:
|
69
67
|
Initializes instance attributes with values from config file or defaults
|
70
|
-
Sets up logging based on verbose parameter
|
71
68
|
"""
|
72
69
|
self.logger = logging.getLogger(__name__)
|
73
70
|
self.config_file_path = config_file_path
|
sokrates_mcp/workflow.py
CHANGED
@@ -10,7 +10,25 @@ from sokrates.coding.code_review_workflow import run_code_review
|
|
10
10
|
from .mcp_config import MCPConfig
|
11
11
|
from .utils import Utils
|
12
12
|
|
13
|
+
"""Workflow module for Sokrates MCP server.
|
14
|
+
|
15
|
+
This module implements the :class:`Workflow` class which encapsulates
|
16
|
+
all business logic exposed as FastMCP tools. It relies on a validated
|
17
|
+
:class:`~sokrates_mcp.mcp_config.MCPConfig` instance and uses the
|
18
|
+
`sokrates` library to interact with LLM providers.
|
19
|
+
"""
|
20
|
+
|
21
|
+
"""Workflow module for Sokrates MCP server.
|
22
|
+
|
23
|
+
This module implements the :class:`Workflow` class which encapsulates
|
24
|
+
all business logic exposed as FastMCP tools. It relies on a validated
|
25
|
+
:class:`~sokrates_mcp.mcp_config.MCPConfig` instance and uses the
|
26
|
+
`sokrates` library to interact with LLM providers.
|
27
|
+
"""
|
28
|
+
|
13
29
|
class Workflow:
|
30
|
+
|
31
|
+
|
14
32
|
|
15
33
|
WORKFLOW_COMPLETION_MESSAGE = "Workflow completed."
|
16
34
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: sokrates-mcp
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.2
|
4
4
|
Summary: A templated MCP server for demonstration and quick start.
|
5
5
|
Author-email: Julian Weber <julianweberdev@gmail.com>
|
6
6
|
License: MIT License
|
@@ -39,7 +39,7 @@ Dynamic: license-file
|
|
39
39
|
# sokrates-mcp
|
40
40
|
|
41
41
|
[](https://opensource.org/licenses/MIT)
|
42
|
-
[](https://github.com/Kubementat/sokrates-mcp)
|
43
43
|
|
44
44
|
A MCP server offering tools for prompt refinement and execution workflows using the FastMCP framework and the `sokrates` python library.
|
45
45
|
|
@@ -214,6 +214,9 @@ If you see "ModuleNotFoundError: fastmcp", ensure:
|
|
214
214
|
|
215
215
|
## Changelog
|
216
216
|
|
217
|
+
**0.4.2 (Sep 2025)**
|
218
|
+
- Update version to 0.4.2
|
219
|
+
|
217
220
|
**0.4.1 (Sep 2025)**
|
218
221
|
- fix roll_dice tool
|
219
222
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
sokrates_mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
sokrates_mcp/main.py,sha256=pgzEnMAkCv9nS9JJ-ZRh_oigvTNBhel87WqAWgvpsEM,19308
|
3
|
+
sokrates_mcp/mcp_config.py,sha256=0dvxg5Uyug_-P0UL97ahKrhHmP5A2HyNP7_FMy3aWy0,12193
|
4
|
+
sokrates_mcp/utils.py,sha256=LOXRXjuEVhqVjJeJ7Rnn7eAVwzZEbWz7Vn9pwVb9oac,795
|
5
|
+
sokrates_mcp/workflow.py,sha256=IF9G6U7RicLLfclnSFiOFt5JWDq1NvpoSMT-6rbzGA4,18273
|
6
|
+
sokrates_mcp-0.4.2.dist-info/licenses/LICENSE,sha256=OgJ7nuNhaIefjDRK0wTGOErJ_c1984Eg9oUweycmal0,1068
|
7
|
+
sokrates_mcp_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
+
sokrates_mcp_client/mcp_client_example.py,sha256=L5_xH0u7lt0k0t_eiFFhN9FVU__seFhxHfRixdy14PU,3866
|
9
|
+
sokrates_mcp-0.4.2.dist-info/METADATA,sha256=aWHURgbD6mCAym1gTO1Dw-fDIjWiFtZiRVHy_OrlM9s,6720
|
10
|
+
sokrates_mcp-0.4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
11
|
+
sokrates_mcp-0.4.2.dist-info/entry_points.txt,sha256=7gYOgoyRs_mE6dmwMJrAtrMns2mxv4ZbqXBznRh3sUc,56
|
12
|
+
sokrates_mcp-0.4.2.dist-info/top_level.txt,sha256=Nbwxz5Mm6LVkglOxqt4ZyEO5A6D4VjjN8c6d-fQyc3k,33
|
13
|
+
sokrates_mcp-0.4.2.dist-info/RECORD,,
|
@@ -1,13 +0,0 @@
|
|
1
|
-
sokrates_mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
sokrates_mcp/main.py,sha256=Mm9DcviqzZgoZphKO0mqgPtc2vqNaLQKqU_CVw5OkEI,23883
|
3
|
-
sokrates_mcp/mcp_config.py,sha256=5MnKhmZTCUhZQwhq1mlxuZwaAyC7Sw9VkMZ-DfMACoM,12395
|
4
|
-
sokrates_mcp/utils.py,sha256=LOXRXjuEVhqVjJeJ7Rnn7eAVwzZEbWz7Vn9pwVb9oac,795
|
5
|
-
sokrates_mcp/workflow.py,sha256=HxDIIabrinT2E6aSNELP2jAKKXdMkipbUO4y5jqQqoo,17655
|
6
|
-
sokrates_mcp-0.4.1.dist-info/licenses/LICENSE,sha256=OgJ7nuNhaIefjDRK0wTGOErJ_c1984Eg9oUweycmal0,1068
|
7
|
-
sokrates_mcp_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
-
sokrates_mcp_client/mcp_client_example.py,sha256=L5_xH0u7lt0k0t_eiFFhN9FVU__seFhxHfRixdy14PU,3866
|
9
|
-
sokrates_mcp-0.4.1.dist-info/METADATA,sha256=3q4Ena0hIzli-_MEHVLzxVpl6RLhoUu1dav83ZoiZV0,6672
|
10
|
-
sokrates_mcp-0.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
11
|
-
sokrates_mcp-0.4.1.dist-info/entry_points.txt,sha256=7gYOgoyRs_mE6dmwMJrAtrMns2mxv4ZbqXBznRh3sUc,56
|
12
|
-
sokrates_mcp-0.4.1.dist-info/top_level.txt,sha256=Nbwxz5Mm6LVkglOxqt4ZyEO5A6D4VjjN8c6d-fQyc3k,33
|
13
|
-
sokrates_mcp-0.4.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|