mcp-ticketer 0.3.0__py3-none-any.whl → 2.2.9__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.
- mcp_ticketer/__init__.py +10 -10
- mcp_ticketer/__version__.py +3 -3
- mcp_ticketer/_version_scm.py +1 -0
- mcp_ticketer/adapters/__init__.py +2 -0
- mcp_ticketer/adapters/aitrackdown.py +930 -52
- mcp_ticketer/adapters/asana/__init__.py +15 -0
- mcp_ticketer/adapters/asana/adapter.py +1537 -0
- mcp_ticketer/adapters/asana/client.py +292 -0
- mcp_ticketer/adapters/asana/mappers.py +348 -0
- mcp_ticketer/adapters/asana/types.py +146 -0
- mcp_ticketer/adapters/github/__init__.py +26 -0
- mcp_ticketer/adapters/github/adapter.py +3229 -0
- mcp_ticketer/adapters/github/client.py +335 -0
- mcp_ticketer/adapters/github/mappers.py +797 -0
- mcp_ticketer/adapters/github/queries.py +692 -0
- mcp_ticketer/adapters/github/types.py +460 -0
- mcp_ticketer/adapters/hybrid.py +58 -16
- mcp_ticketer/adapters/jira/__init__.py +35 -0
- mcp_ticketer/adapters/jira/adapter.py +1351 -0
- mcp_ticketer/adapters/jira/client.py +271 -0
- mcp_ticketer/adapters/jira/mappers.py +246 -0
- mcp_ticketer/adapters/jira/queries.py +216 -0
- mcp_ticketer/adapters/jira/types.py +304 -0
- mcp_ticketer/adapters/linear/__init__.py +1 -1
- mcp_ticketer/adapters/linear/adapter.py +3810 -462
- mcp_ticketer/adapters/linear/client.py +312 -69
- mcp_ticketer/adapters/linear/mappers.py +305 -85
- mcp_ticketer/adapters/linear/queries.py +317 -17
- mcp_ticketer/adapters/linear/types.py +187 -64
- mcp_ticketer/adapters/linear.py +2 -2
- mcp_ticketer/analysis/__init__.py +56 -0
- mcp_ticketer/analysis/dependency_graph.py +255 -0
- mcp_ticketer/analysis/health_assessment.py +304 -0
- mcp_ticketer/analysis/orphaned.py +218 -0
- mcp_ticketer/analysis/project_status.py +594 -0
- mcp_ticketer/analysis/similarity.py +224 -0
- mcp_ticketer/analysis/staleness.py +266 -0
- mcp_ticketer/automation/__init__.py +11 -0
- mcp_ticketer/automation/project_updates.py +378 -0
- mcp_ticketer/cache/memory.py +9 -8
- mcp_ticketer/cli/adapter_diagnostics.py +91 -54
- mcp_ticketer/cli/auggie_configure.py +116 -15
- mcp_ticketer/cli/codex_configure.py +274 -82
- mcp_ticketer/cli/configure.py +1323 -151
- mcp_ticketer/cli/cursor_configure.py +314 -0
- mcp_ticketer/cli/diagnostics.py +209 -114
- mcp_ticketer/cli/discover.py +297 -26
- mcp_ticketer/cli/gemini_configure.py +119 -26
- mcp_ticketer/cli/init_command.py +880 -0
- mcp_ticketer/cli/install_mcp_server.py +418 -0
- mcp_ticketer/cli/instruction_commands.py +435 -0
- mcp_ticketer/cli/linear_commands.py +256 -130
- mcp_ticketer/cli/main.py +140 -1544
- mcp_ticketer/cli/mcp_configure.py +1013 -100
- mcp_ticketer/cli/mcp_server_commands.py +415 -0
- mcp_ticketer/cli/migrate_config.py +12 -8
- mcp_ticketer/cli/platform_commands.py +123 -0
- mcp_ticketer/cli/platform_detection.py +477 -0
- mcp_ticketer/cli/platform_installer.py +545 -0
- mcp_ticketer/cli/project_update_commands.py +350 -0
- mcp_ticketer/cli/python_detection.py +126 -0
- mcp_ticketer/cli/queue_commands.py +15 -15
- mcp_ticketer/cli/setup_command.py +794 -0
- mcp_ticketer/cli/simple_health.py +84 -59
- mcp_ticketer/cli/ticket_commands.py +1375 -0
- mcp_ticketer/cli/update_checker.py +313 -0
- mcp_ticketer/cli/utils.py +195 -72
- mcp_ticketer/core/__init__.py +64 -1
- mcp_ticketer/core/adapter.py +618 -18
- mcp_ticketer/core/config.py +77 -68
- mcp_ticketer/core/env_discovery.py +75 -16
- mcp_ticketer/core/env_loader.py +121 -97
- mcp_ticketer/core/exceptions.py +32 -24
- mcp_ticketer/core/http_client.py +26 -26
- mcp_ticketer/core/instructions.py +405 -0
- mcp_ticketer/core/label_manager.py +732 -0
- mcp_ticketer/core/mappers.py +42 -30
- mcp_ticketer/core/milestone_manager.py +252 -0
- mcp_ticketer/core/models.py +566 -19
- mcp_ticketer/core/onepassword_secrets.py +379 -0
- mcp_ticketer/core/priority_matcher.py +463 -0
- mcp_ticketer/core/project_config.py +189 -49
- mcp_ticketer/core/project_utils.py +281 -0
- mcp_ticketer/core/project_validator.py +376 -0
- mcp_ticketer/core/registry.py +3 -3
- mcp_ticketer/core/session_state.py +176 -0
- mcp_ticketer/core/state_matcher.py +592 -0
- mcp_ticketer/core/url_parser.py +425 -0
- mcp_ticketer/core/validators.py +69 -0
- mcp_ticketer/defaults/ticket_instructions.md +644 -0
- mcp_ticketer/mcp/__init__.py +29 -1
- mcp_ticketer/mcp/__main__.py +60 -0
- mcp_ticketer/mcp/server/__init__.py +25 -0
- mcp_ticketer/mcp/server/__main__.py +60 -0
- mcp_ticketer/mcp/server/constants.py +58 -0
- mcp_ticketer/mcp/server/diagnostic_helper.py +175 -0
- mcp_ticketer/mcp/server/dto.py +195 -0
- mcp_ticketer/mcp/server/main.py +1343 -0
- mcp_ticketer/mcp/server/response_builder.py +206 -0
- mcp_ticketer/mcp/server/routing.py +723 -0
- mcp_ticketer/mcp/server/server_sdk.py +151 -0
- mcp_ticketer/mcp/server/tools/__init__.py +69 -0
- mcp_ticketer/mcp/server/tools/analysis_tools.py +854 -0
- mcp_ticketer/mcp/server/tools/attachment_tools.py +224 -0
- mcp_ticketer/mcp/server/tools/bulk_tools.py +330 -0
- mcp_ticketer/mcp/server/tools/comment_tools.py +152 -0
- mcp_ticketer/mcp/server/tools/config_tools.py +1564 -0
- mcp_ticketer/mcp/server/tools/diagnostic_tools.py +211 -0
- mcp_ticketer/mcp/server/tools/hierarchy_tools.py +942 -0
- mcp_ticketer/mcp/server/tools/instruction_tools.py +295 -0
- mcp_ticketer/mcp/server/tools/label_tools.py +942 -0
- mcp_ticketer/mcp/server/tools/milestone_tools.py +338 -0
- mcp_ticketer/mcp/server/tools/pr_tools.py +150 -0
- mcp_ticketer/mcp/server/tools/project_status_tools.py +158 -0
- mcp_ticketer/mcp/server/tools/project_update_tools.py +473 -0
- mcp_ticketer/mcp/server/tools/search_tools.py +318 -0
- mcp_ticketer/mcp/server/tools/session_tools.py +308 -0
- mcp_ticketer/mcp/server/tools/ticket_tools.py +1413 -0
- mcp_ticketer/mcp/server/tools/user_ticket_tools.py +364 -0
- mcp_ticketer/queue/__init__.py +1 -0
- mcp_ticketer/queue/health_monitor.py +168 -136
- mcp_ticketer/queue/manager.py +78 -63
- mcp_ticketer/queue/queue.py +108 -21
- mcp_ticketer/queue/run_worker.py +2 -2
- mcp_ticketer/queue/ticket_registry.py +213 -155
- mcp_ticketer/queue/worker.py +96 -58
- mcp_ticketer/utils/__init__.py +5 -0
- mcp_ticketer/utils/token_utils.py +246 -0
- mcp_ticketer-2.2.9.dist-info/METADATA +1396 -0
- mcp_ticketer-2.2.9.dist-info/RECORD +158 -0
- mcp_ticketer-2.2.9.dist-info/top_level.txt +2 -0
- py_mcp_installer/examples/phase3_demo.py +178 -0
- py_mcp_installer/scripts/manage_version.py +54 -0
- py_mcp_installer/setup.py +6 -0
- py_mcp_installer/src/py_mcp_installer/__init__.py +153 -0
- py_mcp_installer/src/py_mcp_installer/command_builder.py +445 -0
- py_mcp_installer/src/py_mcp_installer/config_manager.py +541 -0
- py_mcp_installer/src/py_mcp_installer/exceptions.py +243 -0
- py_mcp_installer/src/py_mcp_installer/installation_strategy.py +617 -0
- py_mcp_installer/src/py_mcp_installer/installer.py +656 -0
- py_mcp_installer/src/py_mcp_installer/mcp_inspector.py +750 -0
- py_mcp_installer/src/py_mcp_installer/platform_detector.py +451 -0
- py_mcp_installer/src/py_mcp_installer/platforms/__init__.py +26 -0
- py_mcp_installer/src/py_mcp_installer/platforms/claude_code.py +225 -0
- py_mcp_installer/src/py_mcp_installer/platforms/codex.py +181 -0
- py_mcp_installer/src/py_mcp_installer/platforms/cursor.py +191 -0
- py_mcp_installer/src/py_mcp_installer/types.py +222 -0
- py_mcp_installer/src/py_mcp_installer/utils.py +463 -0
- py_mcp_installer/tests/__init__.py +0 -0
- py_mcp_installer/tests/platforms/__init__.py +0 -0
- py_mcp_installer/tests/test_platform_detector.py +17 -0
- mcp_ticketer/adapters/github.py +0 -1354
- mcp_ticketer/adapters/jira.py +0 -1011
- mcp_ticketer/mcp/server.py +0 -2030
- mcp_ticketer-0.3.0.dist-info/METADATA +0 -414
- mcp_ticketer-0.3.0.dist-info/RECORD +0 -59
- mcp_ticketer-0.3.0.dist-info/top_level.txt +0 -1
- {mcp_ticketer-0.3.0.dist-info → mcp_ticketer-2.2.9.dist-info}/WHEEL +0 -0
- {mcp_ticketer-0.3.0.dist-info → mcp_ticketer-2.2.9.dist-info}/entry_points.txt +0 -0
- {mcp_ticketer-0.3.0.dist-info → mcp_ticketer-2.2.9.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"""MCP tools for system diagnostics and health checks."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from ....cli.diagnostics import SystemDiagnostics
|
|
7
|
+
from ....cli.simple_health import simple_diagnose
|
|
8
|
+
from ..server_sdk import mcp
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@mcp.tool()
|
|
14
|
+
async def system_diagnostics(simple: bool = False) -> dict[str, Any]:
|
|
15
|
+
"""Run system diagnostics to troubleshoot configuration issues.
|
|
16
|
+
|
|
17
|
+
This tool runs comprehensive diagnostics on the mcp-ticketer system,
|
|
18
|
+
including adapter configuration, queue system health, and credential
|
|
19
|
+
validation. Useful for troubleshooting errors and verifying setup.
|
|
20
|
+
|
|
21
|
+
**When to use**:
|
|
22
|
+
- After authentication or configuration errors
|
|
23
|
+
- When ticket operations unexpectedly fail
|
|
24
|
+
- To verify system health before important operations
|
|
25
|
+
- To check adapter connectivity and permissions
|
|
26
|
+
|
|
27
|
+
**Diagnostic checks**:
|
|
28
|
+
- Configuration file validation
|
|
29
|
+
- Adapter initialization and health
|
|
30
|
+
- Queue system status and operations
|
|
31
|
+
- Credential validation (where supported)
|
|
32
|
+
- Recent error log analysis
|
|
33
|
+
- Performance metrics
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
simple: Use simple diagnostics (faster, fewer dependencies).
|
|
37
|
+
Recommended if full diagnostics are failing.
|
|
38
|
+
Default: False (run full diagnostics)
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
Comprehensive diagnostic report with:
|
|
42
|
+
- status: "completed" or "error"
|
|
43
|
+
- timestamp: When diagnostics were run
|
|
44
|
+
- version: mcp-ticketer version
|
|
45
|
+
- system_info: Python/platform information
|
|
46
|
+
- configuration: Adapter configuration status
|
|
47
|
+
- adapters: Adapter health results
|
|
48
|
+
- queue_system: Queue worker and operation tests
|
|
49
|
+
- recent_logs: Error/warning log analysis
|
|
50
|
+
- performance: Timing metrics
|
|
51
|
+
- recommendations: Actionable suggestions for fixing issues
|
|
52
|
+
- summary: Human-readable summary of findings
|
|
53
|
+
|
|
54
|
+
Example:
|
|
55
|
+
# Run full diagnostics
|
|
56
|
+
result = await system_diagnostics()
|
|
57
|
+
|
|
58
|
+
# Quick diagnostics if full fails
|
|
59
|
+
result = await system_diagnostics(simple=True)
|
|
60
|
+
|
|
61
|
+
"""
|
|
62
|
+
try:
|
|
63
|
+
if simple:
|
|
64
|
+
# Use simple diagnostics (no heavy dependencies)
|
|
65
|
+
logger.info("Running simple system diagnostics")
|
|
66
|
+
report = simple_diagnose()
|
|
67
|
+
|
|
68
|
+
return {
|
|
69
|
+
"status": "completed",
|
|
70
|
+
"diagnostic_type": "simple",
|
|
71
|
+
"report": report,
|
|
72
|
+
"summary": "Simple diagnostics completed. For full diagnostics, run with simple=False.",
|
|
73
|
+
}
|
|
74
|
+
else:
|
|
75
|
+
# Use full diagnostic suite
|
|
76
|
+
logger.info("Running full system diagnostics")
|
|
77
|
+
diagnostics = SystemDiagnostics()
|
|
78
|
+
report = await diagnostics.run_full_diagnosis()
|
|
79
|
+
|
|
80
|
+
# Add summary based on health score
|
|
81
|
+
adapters_info = report.get("adapters", {})
|
|
82
|
+
healthy = adapters_info.get("healthy_adapters", 0)
|
|
83
|
+
total = adapters_info.get("total_adapters", 0)
|
|
84
|
+
queue_info = report.get("queue_system", {})
|
|
85
|
+
queue_health = queue_info.get("health_score", 0)
|
|
86
|
+
|
|
87
|
+
issues = []
|
|
88
|
+
if healthy < total:
|
|
89
|
+
issues.append(f"{total - healthy} adapter(s) failing")
|
|
90
|
+
if queue_health < 50:
|
|
91
|
+
issues.append("queue system unhealthy")
|
|
92
|
+
|
|
93
|
+
if issues:
|
|
94
|
+
summary = f"Issues detected: {', '.join(issues)}. See recommendations for fixes."
|
|
95
|
+
else:
|
|
96
|
+
summary = "All systems healthy. No issues detected."
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
"status": "completed",
|
|
100
|
+
"diagnostic_type": "full",
|
|
101
|
+
"report": report,
|
|
102
|
+
"summary": summary,
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
except Exception as e:
|
|
106
|
+
logger.error(f"System diagnostics failed: {e}", exc_info=True)
|
|
107
|
+
return {
|
|
108
|
+
"status": "error",
|
|
109
|
+
"error": f"Diagnostics failed: {str(e)}",
|
|
110
|
+
"recommendation": "Try running with simple=True for basic diagnostics",
|
|
111
|
+
"fallback_command": "CLI: mcp-ticketer doctor --simple",
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
@mcp.tool()
|
|
116
|
+
async def check_adapter_health(adapter_name: str | None = None) -> dict[str, Any]:
|
|
117
|
+
"""Check health of specific adapter or all configured adapters.
|
|
118
|
+
|
|
119
|
+
Performs a quick health check on adapter(s) by attempting to
|
|
120
|
+
initialize and make a test API call. Useful for verifying
|
|
121
|
+
credentials and connectivity.
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
adapter_name: Specific adapter to check (e.g., "linear", "github").
|
|
125
|
+
If None, checks all configured adapters.
|
|
126
|
+
Default: None (check all)
|
|
127
|
+
|
|
128
|
+
Returns:
|
|
129
|
+
Health check results with:
|
|
130
|
+
- status: "completed" or "error"
|
|
131
|
+
- adapters: Dict mapping adapter names to health status
|
|
132
|
+
- healthy_count: Number of healthy adapters
|
|
133
|
+
- failed_count: Number of failed adapters
|
|
134
|
+
- details: Detailed information about each adapter
|
|
135
|
+
|
|
136
|
+
Example:
|
|
137
|
+
# Check all adapters
|
|
138
|
+
result = await check_adapter_health()
|
|
139
|
+
|
|
140
|
+
# Check specific adapter
|
|
141
|
+
result = await check_adapter_health(adapter_name="linear")
|
|
142
|
+
|
|
143
|
+
"""
|
|
144
|
+
try:
|
|
145
|
+
from ....cli.utils import CommonPatterns
|
|
146
|
+
from ....core.registry import AdapterRegistry
|
|
147
|
+
|
|
148
|
+
# Load configuration
|
|
149
|
+
config = CommonPatterns.load_config()
|
|
150
|
+
adapters_config = config.get("adapters", {})
|
|
151
|
+
|
|
152
|
+
if not adapters_config:
|
|
153
|
+
return {
|
|
154
|
+
"status": "error",
|
|
155
|
+
"error": "No adapters configured",
|
|
156
|
+
"recommendation": "Configure at least one adapter in config file",
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
# Determine which adapters to check
|
|
160
|
+
if adapter_name:
|
|
161
|
+
if adapter_name not in adapters_config:
|
|
162
|
+
return {
|
|
163
|
+
"status": "error",
|
|
164
|
+
"error": f"Adapter '{adapter_name}' not found in configuration",
|
|
165
|
+
"available_adapters": list(adapters_config.keys()),
|
|
166
|
+
}
|
|
167
|
+
adapters_to_check = {adapter_name: adapters_config[adapter_name]}
|
|
168
|
+
else:
|
|
169
|
+
adapters_to_check = adapters_config
|
|
170
|
+
|
|
171
|
+
# Check each adapter
|
|
172
|
+
results = {}
|
|
173
|
+
healthy_count = 0
|
|
174
|
+
failed_count = 0
|
|
175
|
+
|
|
176
|
+
for name, adapter_config in adapters_to_check.items():
|
|
177
|
+
try:
|
|
178
|
+
# Initialize adapter
|
|
179
|
+
adapter = AdapterRegistry.get_adapter(name, adapter_config)
|
|
180
|
+
|
|
181
|
+
# Test with simple list operation
|
|
182
|
+
await adapter.list(limit=1)
|
|
183
|
+
|
|
184
|
+
results[name] = {
|
|
185
|
+
"status": "healthy",
|
|
186
|
+
"message": "Adapter initialized and API call successful",
|
|
187
|
+
}
|
|
188
|
+
healthy_count += 1
|
|
189
|
+
|
|
190
|
+
except Exception as e:
|
|
191
|
+
results[name] = {
|
|
192
|
+
"status": "failed",
|
|
193
|
+
"error": str(e),
|
|
194
|
+
"error_type": type(e).__name__,
|
|
195
|
+
}
|
|
196
|
+
failed_count += 1
|
|
197
|
+
|
|
198
|
+
return {
|
|
199
|
+
"status": "completed",
|
|
200
|
+
"adapters": results,
|
|
201
|
+
"healthy_count": healthy_count,
|
|
202
|
+
"failed_count": failed_count,
|
|
203
|
+
"summary": f"{healthy_count}/{len(adapters_to_check)} adapters healthy",
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
except Exception as e:
|
|
207
|
+
logger.error(f"Adapter health check failed: {e}", exc_info=True)
|
|
208
|
+
return {
|
|
209
|
+
"status": "error",
|
|
210
|
+
"error": f"Health check failed: {str(e)}",
|
|
211
|
+
}
|