Skip to main content
Glama
Dhavaleswar

Explore MCP

by Dhavaleswar
mcp_llm_mode1.py761 B
# python from utils.helpers import get_api_key import os import logging logging.basicConfig( level=logging.DEBUG, format="%(asctime)s [%(levelname)s] %(name)s: %(message)s", ) from openai import OpenAI # Ensure the OpenAI API key is available to the OpenAI SDK os.environ["OPENAI_API_KEY"] = get_api_key() # Use the base URL; the MCP client will handle any internal MCP pathing. TOOL_SERVER_URL = "http://localhost:8000/mcp/" client = OpenAI() response = client.responses.create( model="gpt-4.1", input="call ping", tools=[ { "type": "mcp", "server_label": "local-fastmcp", "server_url": TOOL_SERVER_URL, "require_approval": "never" } ], ) print(response.output_text)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dhavaleswar/explore-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server