xlsx-for-ai 2.21.0 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/mcp.js +37 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -194,6 +194,7 @@ For custom MCP clients, the binary is `xlsx-for-ai-mcp` (stdio transport). Overr
|
|
|
194
194
|
| Tool | What it does |
|
|
195
195
|
|---|---|
|
|
196
196
|
| `xlsx_post_slack` | Post a workbook to a Slack channel as a file attachment with an optional message. BYOA — the agent supplies the user's Slack bot token (`xoxb-…`); the token is forwarded to Slack and never persisted. Uses Slack's external upload flow. |
|
|
197
|
+
| `xlsx_post_teams` | Post a workbook to a Microsoft Teams channel as a file attachment in a channel message, with an optional message. BYOA — the agent supplies the user's Microsoft Graph access token (JWT); the token is forwarded to Microsoft and never persisted. Uses Graph's filesFolder + upload-session + post-message flow. |
|
|
197
198
|
|
|
198
199
|
Tool responses include a citation footer and a `_meta` block (tool name, version, tier, request ID, `powered_by`). Both pass through verbatim; nothing is stripped.
|
|
199
200
|
|
package/mcp.js
CHANGED
|
@@ -849,6 +849,29 @@ const TOOLS = [
|
|
|
849
849
|
required: ['file_path', 'channel', 'slack_token'],
|
|
850
850
|
},
|
|
851
851
|
},
|
|
852
|
+
|
|
853
|
+
{
|
|
854
|
+
name: 'xlsx_post_teams',
|
|
855
|
+
description:
|
|
856
|
+
'xlsx-for-ai — read, write, diff, redact, supervise .xlsx files locally.\n' +
|
|
857
|
+
'This tool: upload a local .xlsx file to a Microsoft Teams channel as a file attachment in a channel message, with an optional accompanying message. BYOA — the agent must pass the user\'s Microsoft Graph access token (a JWT starting with "eyJ"). The token is forwarded to Microsoft Graph and never stored server-side.\n' +
|
|
858
|
+
'Uses Microsoft Graph\'s 4-step flow: locate the channel\'s filesFolder driveItem, create an upload session, upload the bytes, then post a chatMessage with the file as an inline attachment.\n\n' +
|
|
859
|
+
'USE WHEN: the user asks "post this workbook to my Teams channel," "share this with the team in Teams," or any other outbound-file-to-Teams request. The agent has just produced or modified a workbook and wants to deliver it to a Microsoft Teams channel. ' +
|
|
860
|
+
'Free tier — counts against the 10k/mo cap.\n\n' +
|
|
861
|
+
'DO NOT USE WHEN: posting to Slack (use xlsx_post_slack). Or when there is no Microsoft Graph token available — the user must have an Entra ID app registration with Group.ReadWrite.All or Files.ReadWrite.All + ChannelMessage.Send scopes, AND a valid access token for that app.',
|
|
862
|
+
inputSchema: {
|
|
863
|
+
type: 'object',
|
|
864
|
+
properties: {
|
|
865
|
+
file_path: { type: 'string', description: 'Absolute path to the .xlsx file to post.' },
|
|
866
|
+
team_id: { type: 'string', description: 'Microsoft Teams team ID (GUID). Find via Graph: GET /me/joinedTeams.' },
|
|
867
|
+
channel_id: { type: 'string', description: 'Microsoft Teams channel ID. Find via Graph: GET /teams/{team-id}/channels.' },
|
|
868
|
+
graph_token: { type: 'string', description: 'Microsoft Graph access token (JWT). Forwarded to Microsoft; never persisted by us. Must have file-upload + channel-message-send scopes.' },
|
|
869
|
+
message: { type: 'string', description: 'Optional: message to post alongside the file. Plain text; will be HTML-escaped server-side.' },
|
|
870
|
+
filename: { type: 'string', description: 'Optional: filename Teams will display. Defaults to the basename of file_path.' },
|
|
871
|
+
},
|
|
872
|
+
required: ['file_path', 'team_id', 'channel_id', 'graph_token'],
|
|
873
|
+
},
|
|
874
|
+
},
|
|
852
875
|
];
|
|
853
876
|
|
|
854
877
|
// ---------------------------------------------------------------------------
|
|
@@ -1076,6 +1099,20 @@ async function dispatchTool(name, args) {
|
|
|
1076
1099
|
return callTool('xlsx_post_slack', body);
|
|
1077
1100
|
}
|
|
1078
1101
|
|
|
1102
|
+
// xlsx_post_teams: outbound file-to-Teams. Same shape as Slack but with
|
|
1103
|
+
// Microsoft Graph fields (team_id + channel_id + graph_token).
|
|
1104
|
+
if (name === 'xlsx_post_teams') {
|
|
1105
|
+
const body = {
|
|
1106
|
+
file_b64: fileToB64(args.file_path),
|
|
1107
|
+
team_id: args.team_id,
|
|
1108
|
+
channel_id: args.channel_id,
|
|
1109
|
+
graph_token: args.graph_token,
|
|
1110
|
+
};
|
|
1111
|
+
if (args.message !== undefined) body.message = args.message;
|
|
1112
|
+
body.filename = args.filename || path.basename(args.file_path);
|
|
1113
|
+
return callTool('xlsx_post_teams', body);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1079
1116
|
// All other tools (list_sheets, schema, hyperlinks, conditional_formats,
|
|
1080
1117
|
// styles, etc.) — single-file relay. Forward any common option keys the
|
|
1081
1118
|
// routes accept so we don't silently drop them. New keys added here as
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xlsx-for-ai",
|
|
3
3
|
"mcpName": "io.github.senoff/xlsx-for-ai",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.22.0",
|
|
5
5
|
"description": "The MCP server that makes LLMs reliable on real-world Excel spreadsheets. Thin npm client over a hosted API — read, write, diff, redact, and supervise .xlsx files from any MCP-aware agent.",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"bin": {
|