Skip to main content
Glama
dify-client.js1.1 kB
import axios from 'axios'; export class DifyClient { client; constructor(baseUrl, appSk) { this.client = axios.create({ baseURL: baseUrl, headers: { Authorization: `Bearer ${appSk}`, 'Content-Type': 'application/json' } }); } async getAppInfo() { const response = await this.client.get('/info'); return response.data; } async getParameters() { const response = await this.client.get('/parameters'); return response.data; } async runWorkflow(inputs) { const response = await this.client.post('/workflows/run', { inputs, response_mode: 'streaming', user: `dify-mcp-server-ts-${Math.random().toString(16).slice(0, 12)}` }, { headers: { 'Content-Type': 'application/json' } }); return response.data.answer || 'No response from workflow'; } async stopExecution(taskId) { await this.client.post(`/chat-messages/${taskId}/stop`); } }

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/faiz-gear/dify-mcp-server-ts'

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