@langwatch/mcp-server 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/.eslintrc.cjs ADDED
@@ -0,0 +1,37 @@
1
+ /** @type {import("eslint").Linter.Config} */
2
+ const config = {
3
+ parser: "@typescript-eslint/parser",
4
+ parserOptions: {
5
+ project: true,
6
+ },
7
+ plugins: ["@typescript-eslint"],
8
+ extends: [
9
+ "plugin:@typescript-eslint/recommended-type-checked",
10
+ "plugin:@typescript-eslint/stylistic-type-checked",
11
+ ],
12
+ rules: {
13
+ // These opinionated rules are enabled in stylistic-type-checked above.
14
+ // Feel free to reconfigure them to your own preference.
15
+ "@typescript-eslint/array-type": "off",
16
+ "@typescript-eslint/consistent-type-definitions": "off",
17
+ "@typescript-eslint/no-explicit-any": "off",
18
+ "@typescript-eslint/no-unsafe-assignment": "off",
19
+ "@typescript-eslint/ban-ts-comment": "off",
20
+ "@typescript-eslint/require-await": "off",
21
+ "@typescript-eslint/no-unsafe-member-access": "off",
22
+ "@typescript-eslint/no-unsafe-call": "off",
23
+ "@typescript-eslint/no-unsafe-argument": "off",
24
+ "@typescript-eslint/no-unsafe-return": "off",
25
+
26
+ "@typescript-eslint/consistent-type-imports": [
27
+ "warn",
28
+ {
29
+ prefer: "type-imports",
30
+ fixStyle: "inline-type-imports",
31
+ },
32
+ ],
33
+ "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
34
+ },
35
+ };
36
+
37
+ module.exports = config;
package/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # LangWatch 🏰 MCP Server
2
+
3
+ The LangWatch MCP Server is a tool designed to aid finding, searching, and looking up Traces from the LangWatch platform via the [Model Context Protocol](https://modelcontextprotocol.io/introduction).
4
+
5
+ This server facilitates communication with LangWatch's API, allowing you to retrieve and manage LLM traces.
6
+
7
+ ## Setup in Cursor 👩‍💻
8
+
9
+ 1. Navigate to the Cursor Settings
10
+ 2. Navigate to the MCP item in the sidebar
11
+ 3. Set the "name" as "LangWatch MCP"
12
+ 4. Set the "type" to `command`
13
+ 5. Set the "command" to `npx @langwatch/mcp-server`
14
+
15
+ > [!TIP]
16
+ > By default the environment variable `LANGWATCH_API_KEY` and `LANGWATCH_ENDPOINT` are pulled into the project. If that isn't an option for you, you can also use arguments in the command inside Cursor.
17
+
18
+ - `--apiKey`: Your LangWatch API key. This is mandatory and must be provided.
19
+ - `--endpoint`: The endpoint for the LangWatch API. Defaults to `https://app.langwatch.ai` if not specified.
20
+
21
+ <picture>
22
+ <source media="(prefers-color-scheme: dark)" srcset="../assets/mcp-server/cursor-setup.dark.webp">
23
+ <source media="(prefers-color-scheme: light)" srcset="../assets/mcp-server/cursor-setup.light.webp">
24
+ <img alt="LangWatch Logo" src="../assets/mcp-server/cursor-setup.light.webp" width="900">
25
+ </picture>
26
+
27
+ ## Tools
28
+
29
+ The MCP Server provides the following tools:
30
+
31
+ ### `get_latest_traces`
32
+
33
+ - **Description:** Retrieves the latest LLM traces.
34
+ - **Parameters:**
35
+ - `pageOffset` (optional): The page offset for pagination.
36
+ - `daysBackToSearch` (optional): The number of days back to search for traces. Defaults to 1.
37
+
38
+ ### `get_trace_by_id`
39
+
40
+ - **Description:** Retrieves a specific LLM trace by its ID.
41
+ - **Parameters:**
42
+ - `id`: The ID of the trace to retrieve.
43
+
44
+ ## Usage in Cursor
45
+
46
+ To use these tools within Cursor, follow these steps:
47
+
48
+ 1. **Open the Cursor Chat view:**
49
+ - `Cmd + I`
50
+
51
+ 2. **Ensure the MCP server is running:**
52
+
53
+ 3. **Interact with your Agent:**
54
+ - Ask a question like the following to test the tools are accessible: *Note: When the tool is detected, you'll need to run `Run tool` in the chat view for it to be called.
55
+ - > "I just ran into an issue while debugging, show me the latest traces from the last 30 days"
56
+
57
+ <picture>
58
+ <source media="(prefers-color-scheme: dark)" srcset="../assets/mcp-server/cursor-example.dark.webp">
59
+ <source media="(prefers-color-scheme: light)" srcset="../assets/mcp-server/cursor-example.light.webp">
60
+ <img alt="LangWatch Logo" src="../assets/mcp-server/cursor-example.light.webp" width="900">
61
+ </picture>
62
+
63
+
64
+ ## 🛟 Support
65
+
66
+ If you have questions or need help, join our community:
67
+
68
+ - [Discord Community](https://discord.gg/kT4PhDS2gH)
69
+ - [Email Support](mailto:support@langwatch.ai)
@@ -0,0 +1,2 @@
1
+
2
+ export { }