Created
July 31, 2025 10:07
-
-
Save samuelcolvin/3a162855b9b9ed22500d3c4a209029b6 to your computer and use it in GitHub Desktop.
test logfire-mcp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# requires-python = ">=3.13" | |
# dependencies = [ | |
# "devtools", | |
# "mcp", | |
# "python-dotenv", | |
# ] | |
# /// | |
import asyncio | |
import os | |
from devtools import debug | |
from dotenv import load_dotenv | |
from mcp import ClientSession, StdioServerParameters | |
from mcp.client.stdio import stdio_client | |
load_dotenv() | |
server_params = StdioServerParameters( | |
command='uvx', args=['logfire-mcp@latest', '--read-token', os.environ['LOGFIRE_READ_TOKEN']] | |
) | |
async def main(): | |
async with stdio_client(server_params) as (read, write): | |
async with ClientSession(read, write) as session: | |
await session.initialize() | |
debug(await session.list_resources()) | |
debug(await session.list_tools()) | |
debug(await session.call_tool('get_logfire_records_schema')) | |
if __name__ == '__main__': | |
asyncio.run(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment