Skip to main content
Glama

Office MCP Server

by walkingzzzy
DocumentAdapterFactory.ts1.07 kB
import { IDocumentAdapter, DocumentType } from './IDocumentAdapter'; import { WordAdapter } from './WordAdapter'; import { ExcelAdapter } from './ExcelAdapter'; import { PowerPointAdapter } from './PowerPointAdapter'; export class DocumentAdapterFactory { static createAdapter(): IDocumentAdapter { const hostType = Office.context.host; switch (hostType) { case Office.HostType.Word: return new WordAdapter(); case Office.HostType.Excel: return new ExcelAdapter(); case Office.HostType.PowerPoint: return new PowerPointAdapter(); default: throw new Error(`不支持的Office应用类型: ${hostType}`); } } static getDocumentType(): DocumentType { const hostType = Office.context.host; switch (hostType) { case Office.HostType.Word: return 'word'; case Office.HostType.Excel: return 'excel'; case Office.HostType.PowerPoint: return 'powerpoint'; default: throw new Error(`不支持的Office应用类型: ${hostType}`); } } }

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/walkingzzzy/office-mcp'

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