Skip to main content
Glama

Polygon-io MCP Server

Official
entrypoint.py1.08 kB
#!/usr/bin/env python import os from typing import Literal from mcp_polygon import server def transport() -> Literal["stdio", "sse", "streamable-http"]: """ Determine the transport type for the MCP server. Defaults to 'stdio' if not set in environment variables. """ mcp_transport_str = os.environ.get("MCP_TRANSPORT", "stdio") # These are currently the only supported transports supported_transports: dict[str, Literal["stdio", "sse", "streamable-http"]] = { "stdio": "stdio", "sse": "sse", "streamable-http": "streamable-http", } return supported_transports.get(mcp_transport_str, "stdio") # Ensure the server process doesn't exit immediately when run as an MCP server def start_server(): polygon_api_key = os.environ.get("POLYGON_API_KEY", "") if not polygon_api_key: print("Warning: POLYGON_API_KEY environment variable not set.") else: print("Starting Polygon MCP server with API key configured.") server.run(transport=transport()) if __name__ == "__main__": start_server()

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/polygon-io/mcp_polygon'

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