opik-mcp 0.0.1
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.
- package/LICENSE +203 -0
- package/README.md +203 -0
- package/build/cli.js +72 -0
- package/build/client/index.html +323 -0
- package/build/config.js +205 -0
- package/build/debug-log.js +64 -0
- package/build/index.js +1847 -0
- package/build/mcp-server.js +96 -0
- package/build/test-client.js +436 -0
- package/build/transports/sse-transport.js +169 -0
- package/build/transports/types.js +4 -0
- package/build/types.js +4 -0
- package/build/utils/capabilities.js +303 -0
- package/build/utils/env.js +52 -0
- package/build/utils/examples.js +414 -0
- package/build/utils/metrics-info.js +263 -0
- package/build/utils/tracing-info.js +119 -0
- package/package.json +79 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracing information module for Opik Comet
|
|
3
|
+
* Provides detailed information about Opik's tracing capabilities
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Get information about Opik's tracing capabilities
|
|
7
|
+
* @param topic Optional topic to get specific information about
|
|
8
|
+
* @returns Information about the specified topic or an overview if no topic is provided
|
|
9
|
+
*/
|
|
10
|
+
export function getTracingInfo(topic) {
|
|
11
|
+
// If no topic is provided, return an overview
|
|
12
|
+
if (!topic) {
|
|
13
|
+
return {
|
|
14
|
+
title: 'Opik Tracing Capabilities',
|
|
15
|
+
description: 'Opik provides comprehensive tracing capabilities to help you understand and analyze your LLM applications. Traces capture the full context of LLM interactions, including inputs, outputs, and metadata.',
|
|
16
|
+
availableTopics: ['traces', 'spans', 'feedback', 'search', 'visualization'],
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
// Return information based on the requested topic
|
|
20
|
+
switch (topic.toLowerCase()) {
|
|
21
|
+
case 'traces':
|
|
22
|
+
return {
|
|
23
|
+
title: 'Traces',
|
|
24
|
+
description: 'Traces are complete records of LLM interactions, capturing the full context of a request including inputs, outputs, and metadata. They provide a comprehensive view of how your LLM application is performing.',
|
|
25
|
+
keyFeatures: [
|
|
26
|
+
'Automatic capture of inputs and outputs',
|
|
27
|
+
'Metadata collection for context',
|
|
28
|
+
'Hierarchical structure with spans',
|
|
29
|
+
'Long-term storage and retrieval',
|
|
30
|
+
'Integration with evaluation metrics',
|
|
31
|
+
],
|
|
32
|
+
useCases: [
|
|
33
|
+
'Debugging LLM application issues',
|
|
34
|
+
'Auditing LLM responses',
|
|
35
|
+
'Compliance and governance',
|
|
36
|
+
'Performance analysis',
|
|
37
|
+
'Training data collection',
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
case 'spans':
|
|
41
|
+
return {
|
|
42
|
+
title: 'Spans',
|
|
43
|
+
description: 'Spans are individual units within a trace that represent discrete operations or steps in your LLM application. They help break down complex interactions into manageable pieces for analysis.',
|
|
44
|
+
keyFeatures: [
|
|
45
|
+
'Hierarchical relationship (parent-child)',
|
|
46
|
+
'Timing information for performance analysis',
|
|
47
|
+
'Custom attributes for context',
|
|
48
|
+
'Support for nested operations',
|
|
49
|
+
'Automatic correlation with parent traces',
|
|
50
|
+
],
|
|
51
|
+
useCases: [
|
|
52
|
+
'Performance bottleneck identification',
|
|
53
|
+
'Detailed step-by-step analysis',
|
|
54
|
+
'Tracking complex multi-step LLM workflows',
|
|
55
|
+
'Measuring time spent in different components',
|
|
56
|
+
'Correlating errors with specific operations',
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
case 'feedback':
|
|
60
|
+
return {
|
|
61
|
+
title: 'Feedback',
|
|
62
|
+
description: 'Feedback allows you to annotate traces with human or automated evaluations. This helps you build a dataset of evaluated responses that can be used for model improvement and analysis.',
|
|
63
|
+
keyFeatures: [
|
|
64
|
+
'Binary (thumbs up/down) feedback',
|
|
65
|
+
'Structured feedback with categories',
|
|
66
|
+
'Free-form text comments',
|
|
67
|
+
'Support for multiple feedback sources',
|
|
68
|
+
'Integration with evaluation metrics',
|
|
69
|
+
],
|
|
70
|
+
useCases: [
|
|
71
|
+
'Building labeled datasets for fine-tuning',
|
|
72
|
+
'Identifying patterns in problematic responses',
|
|
73
|
+
'Measuring user satisfaction',
|
|
74
|
+
'Comparing model versions',
|
|
75
|
+
'Creating ground truth for automated evaluations',
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
case 'search':
|
|
79
|
+
return {
|
|
80
|
+
title: 'Search',
|
|
81
|
+
description: 'Opik provides powerful search capabilities to help you find specific traces based on content, metadata, or performance characteristics. This makes it easy to analyze patterns and identify issues.',
|
|
82
|
+
keyFeatures: [
|
|
83
|
+
'Full-text search across inputs and outputs',
|
|
84
|
+
'Metadata filtering',
|
|
85
|
+
'Time-based queries',
|
|
86
|
+
'Performance metric filtering',
|
|
87
|
+
'Support for complex boolean queries',
|
|
88
|
+
],
|
|
89
|
+
useCases: [
|
|
90
|
+
'Finding examples of specific behaviors',
|
|
91
|
+
'Identifying patterns in errors',
|
|
92
|
+
'Analyzing performance trends',
|
|
93
|
+
'Auditing responses for compliance',
|
|
94
|
+
'Building targeted datasets for evaluation',
|
|
95
|
+
],
|
|
96
|
+
};
|
|
97
|
+
case 'visualization':
|
|
98
|
+
return {
|
|
99
|
+
title: 'Visualization',
|
|
100
|
+
description: 'Opik provides visualization tools to help you understand your traces and spans. These visualizations make it easier to identify patterns, bottlenecks, and issues in your LLM applications.',
|
|
101
|
+
keyFeatures: [
|
|
102
|
+
'Timeline views of traces and spans',
|
|
103
|
+
'Performance dashboards',
|
|
104
|
+
'Metric trend analysis',
|
|
105
|
+
'Comparison views for A/B testing',
|
|
106
|
+
'Custom visualization options',
|
|
107
|
+
],
|
|
108
|
+
useCases: [
|
|
109
|
+
'Performance monitoring over time',
|
|
110
|
+
'Comparing model versions',
|
|
111
|
+
'Identifying usage patterns',
|
|
112
|
+
'Tracking evaluation metrics',
|
|
113
|
+
'Presenting insights to stakeholders',
|
|
114
|
+
],
|
|
115
|
+
};
|
|
116
|
+
default:
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "opik-mcp",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "MCP server to interact with Opik - Enables automated prompt optimization",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"opik-mcp": "build/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc && shx chmod +x build/*.js && shx cp -r client build/",
|
|
11
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
12
|
+
"test:transport": "node --experimental-vm-modules node_modules/jest/bin/jest.js --forceExit --detectOpenHandles tests/transports",
|
|
13
|
+
"api:build": "tsc",
|
|
14
|
+
"api:test": "node build/test-client.js",
|
|
15
|
+
"simple": "node build/simple-mcp.js",
|
|
16
|
+
"lint": "eslint . --ext .ts",
|
|
17
|
+
"lint:fix": "eslint . --ext .ts --fix",
|
|
18
|
+
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
19
|
+
"check": "npm run lint && npm run test",
|
|
20
|
+
"start": "node build/index.js",
|
|
21
|
+
"start:sse": "node build/cli.js serve --transport sse",
|
|
22
|
+
"start:stdio": "node build/cli.js serve --transport stdio",
|
|
23
|
+
"dev:sse": "tsc && node build/cli.js serve --transport sse"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"build"
|
|
27
|
+
],
|
|
28
|
+
"author": "Opik",
|
|
29
|
+
"license": "Apache-2.0",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"dotenv": "^16.4.5",
|
|
32
|
+
"yargs": "^17.7.2",
|
|
33
|
+
"zod": "^3.24.2"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@jest/globals": "^29.7.0",
|
|
37
|
+
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
38
|
+
"@types/cors": "^2.8.17",
|
|
39
|
+
"@types/express": "^5.0.0",
|
|
40
|
+
"@types/jest": "^29.5.12",
|
|
41
|
+
"@types/node": "^22.13.9",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
43
|
+
"@typescript-eslint/parser": "^7.4.0",
|
|
44
|
+
"cors": "^2.8.5",
|
|
45
|
+
"eslint": "^8.57.0",
|
|
46
|
+
"eslint-config-prettier": "^9.1.0",
|
|
47
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
48
|
+
"express": "^5.0.1",
|
|
49
|
+
"jest": "^29.7.0",
|
|
50
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
51
|
+
"node-fetch": "^3.3.2",
|
|
52
|
+
"pre-commit": "^1.2.2",
|
|
53
|
+
"prettier": "^3.2.5",
|
|
54
|
+
"shx": "^0.3.4",
|
|
55
|
+
"ts-jest": "^29.1.2",
|
|
56
|
+
"typescript": "^5.8.2"
|
|
57
|
+
},
|
|
58
|
+
"jest": {
|
|
59
|
+
"preset": "ts-jest/presets/default-esm",
|
|
60
|
+
"extensionsToTreatAsEsm": [
|
|
61
|
+
".ts"
|
|
62
|
+
],
|
|
63
|
+
"transform": {
|
|
64
|
+
"^.+\\.tsx?$": [
|
|
65
|
+
"ts-jest",
|
|
66
|
+
{
|
|
67
|
+
"useESM": true
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"moduleNameMapper": {
|
|
72
|
+
"^(\\.{1,2}/.*)\\.js$": "$1"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"pre-commit": [
|
|
76
|
+
"lint",
|
|
77
|
+
"test"
|
|
78
|
+
]
|
|
79
|
+
}
|