-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Logfire MCP server documentation #925
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Logfire MCP Server | ||
|
||
**Logfire** has its own [MCP server](https://modelcontextprotocol.io/introduction), which | ||
you can use on [Claude Desktop](https://www.anthropic.com/news/claude-desktop), | ||
[Cursor](https://www.cursor.com/), and any other software that supports MCP Servers. | ||
|
||
## Connect to the MCP server | ||
|
||
Here's how to connect different clients to the MCP server: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The page doesn't tell me what MCP is, what Cursor/Cline/Claude Desktop is, or why I should care about any of this. Opening https://modelcontextprotocol.io/introduction starts with:
which doesn't really help. This page is linked at the top of the how-to guides which makes it seem really important so this needs to be clearer. Even someone who knows about MCP and Cursor and uses those things has to guess what this particular server does. Needs to say something like "Let your AI IDE query your logs and find bugs for you". |
||
|
||
### Cursor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to start with an example that doesn't require setting up a whole IDE for people who are mcp-curious. Like a simple CLI command that I can easily install and run in my project directory. Something where we can show a screenshot or something of the output fairly easily for people who want to see results without running any steps themselves. |
||
|
||
You can configure Cursor by creating a `.cursor/mcp.json` file in your project root: | ||
|
||
```json | ||
{ | ||
"mcpServers": { | ||
"logfire": { | ||
"command": "uvx", | ||
"args": ["logfire-mcp", "--logfire-read-token=YOUR-TOKEN"], | ||
} | ||
} | ||
} | ||
``` | ||
|
||
!!! note | ||
You need to pass the token via the `--logfire-read-token` flag, because Cursor doesn't | ||
support the `env` field in the MCP configuration. | ||
|
||
For more detailed information, you can check the | ||
[Cursor documentation](https://docs.cursor.com/context/model-context-protocol). | ||
|
||
### Claude Desktop | ||
|
||
In Claude Desktop, go to Settings → Advanced and add the following MCP configuration: | ||
```json | ||
{ | ||
"command": ["logfire-mcp"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is missing |
||
"type": "stdio", | ||
"env": { | ||
"LOGFIRE_READ_TOKEN": "your_token" | ||
} | ||
} | ||
``` | ||
|
||
Check out the [MCP quickstart](https://modelcontextprotocol.io/quickstart/user) | ||
for more information. | ||
|
||
### Cline | ||
|
||
When using [Cline](https://docs.cline.bot/), you can configure the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This says
I still don't know what Cline is. |
||
`cline_mcp_settings.json` file to connect to the MCP server: | ||
|
||
```json | ||
{ | ||
"mcpServers": { | ||
"logfire": { | ||
"command": "uvx", | ||
"args": [ | ||
"logfire-mcp", | ||
], | ||
"env": { | ||
"LOGFIRE_READ_TOKEN": "your_token" | ||
}, | ||
"disabled": false, | ||
"autoApprove": [] | ||
} | ||
} | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like there should be a link to https://github.com/pydantic/logfire-mcp. Note that https://pypi.org/project/logfire-mcp/ doesn't link there either. And there should be a mention of the package. It's just sort of implied below that you're using
uvx logfire-mcp
or otherwise installinglogfire-mcp
. Initially I didn't look closely and thought that command came with the logfire package.About the docs and the command:
https://logfire.pydantic.dev/-/redirect/latest-project/settings/read-tokens doesn't work well. For me it links to a random project that I was invited to recentlyish but isn't mine and which I haven't looked at in ages. Rather link to the docs about read tokens. Also include that link here.
--logfire-read-token
is very long for a required argument. I suggest--token
/-t
or at least--read-token
.this should also link to docs about read tokens.
When I run the command successfully it doesn't say anything so I can't tell if it's working properly. I have to press Ctrl+C three times to make it stop. And doing that makes it look like something bad happened: