// Test file upload locally
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { registerAITableTools } from "./aitable-tools.js";
const API_TOKEN = process.env.AITABLE_API_TOKEN || "uskbSSdGVf3VDRXEoXoYTaI";
const SPACE_ID = process.env.SPACE_ID || "spcJfeqydUJu9";
async function testUpload() {
const server = new McpServer({
name: "aitable-mcp-test",
version: "1.0.0",
});
registerAITableTools(server, API_TOKEN, SPACE_ID);
// Test upload_attachment tool
const result = await server.callTool("upload_attachment", {
datasheetId: "dstGdirFCE74jPgVp7", // Document Library
filePath: "C:/Users/HamCh/test-upload.txt"
});
console.log("Upload result:", JSON.stringify(result, null, 2));
}
testUpload().catch(console.error);