Skip to main content
Glama
test-connection.ts2.49 kB
import axios from "axios"; import https from "https"; const config = { wordpressUrl: "https://fluentboards.local", username: "aiagent", appPassword: "E3a3 3Hw5 tVlb HDDm QcUR WYoC", }; const api = axios.create({ baseURL: `${config.wordpressUrl}/wp-json/fluent-boards/v2`, auth: { username: config.username, password: config.appPassword, }, httpsAgent: new https.Agent({ rejectUnauthorized: false, }), }); async function testConnection() { console.log("Testing FluentBoards API connection...\n"); try { // Test 1: List boards console.log("1. Listing boards..."); const boardsResponse = await api.get("/projects"); const boards = boardsResponse.data.boards.data; console.log(`Found ${boards.length} board(s):`); boards.forEach((board: any) => { console.log(` - ${board.title} (ID: ${board.id})`); }); if (boards.length > 0) { const boardId = boards[0].id; // Test 2: Get board details console.log(`\n2. Getting details for board ${boardId}...`); const boardResponse = await api.get(`/projects/${boardId}`); const board = boardResponse.data.board; console.log(`Board: ${board.title}`); console.log( `Stages: ${board.stages.map((s: any) => s.title).join(", ")}` ); // Test 3: List tasks console.log(`\n3. Listing tasks in board ${boardId}...`); const tasksResponse = await api.get(`/projects/${boardId}/tasks`); const tasks = tasksResponse.data.tasks; console.log(`Found ${tasks.length} task(s)`); // Test 4: Create a test task console.log(`\n4. Creating a test task...`); const stages = boardResponse.data.board.stages; const firstStage = stages[0]; const newTask = await api.post(`/projects/${boardId}/tasks`, { task: { title: "Test Task from MCP Server", description: "This is a test task created by the MCP server", board_id: boardId, stage_id: firstStage.id, }, }); console.log( `Created task: ${newTask.data.task.title} (ID: ${newTask.data.task.id})` ); } console.log( "\n✅ All tests passed! The API connection is working correctly." ); } catch (error: any) { console.error("\n❌ Error:", error.message); if (error.response) { console.error("Response status:", error.response.status); console.error("Response data:", error.response.data); } } } testConnection();

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/danieliser/fluent-boards-mcp-server'

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