Skip to main content
Glama

Integration App MCP Server

Official
const { Client } = require('@modelcontextprotocol/sdk/client/index.js'); const { SSEClientTransport } = require('@modelcontextprotocol/sdk/client/sse.js'); const dotenv = require('dotenv'); dotenv.config(); // You need to set these values: const INTEGRATION_KEY = 'hubspot'; // Replace with your actual Integration Key const SERVER_URL = 'http://localhost:3000'; async function testMcpServer() { try { // Create a new MCP client const client = new Client({ name: 'test-client', version: '1.0.0' }); // Create SSE transport with the integration key const transport = new SSEClientTransport( new URL(`${SERVER_URL}/sse?integrationKey=${INTEGRATION_KEY}`) ); // Connect to the server await client.connect(transport); console.log('Connected to MCP server'); // List available tools const tools = await client.listTools(); console.log('Available tools:', tools); // Example: Call a tool if available if (tools.tools.length > 0) { const firstTool = tools.tools[0]; console.log(`Testing tool: ${firstTool.name}`); try { const result = await client.callTool({ name: firstTool.name, arguments: {} // Add appropriate arguments based on the tool's schema }); console.log('Tool result:', result); } catch (error) { console.error('Error calling tool:', error); } } // Close the connection await transport.close(); console.log('Disconnected from MCP server'); } catch (error) { console.error('Test failed:', error); } } // Run the test testMcpServer();

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/integration-app/mcp-server'

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