🚀 Automate spreadsheet tasks with AI. Connect the powerful Univer office suite to any MCP-compatible AI application. This kit provides everything you need to get started: configuration examples to handle Univer's sheets over MCP.
See the code🚀 Automate spreadsheet tasks with AI powered by Univer and Model Context Protocol (MCP)
This starter kit provides a seamless integration between Univer - a powerful open-source office suite engine - and Model Context Protocol (MCP), enabling AI applications to interact with spreadsheets, documents, and presentations through a standardized interface.
This kit integrates several key Univer components:
Univer MCP enables AI applications to interact with spreadsheets through the Model Context Protocol. The architecture includes MCP hosts (like Cursor, Claude), Univer MCP Server, mcp-bridge plugin, and the Univer instance.
📖 For complete architecture details and implementation guide, visit the Univer MCP Repository.
Note: Univer MCP is currently in early development. Chart generation and advanced visualizations will be supported in future releases. We welcome your feedback and feature requests!
This starter kit provides the following MCP tools for AI applications:
📊 Data Operations:
set_range_data - Set values in cell rangesget_range_data - Read cell values and datasearch_cells - Search for specific content in cellsauto_fill - Auto-fill data patternsformat_brush - Copy and apply cell formatting📋 Sheet Management:
create_sheet - Create new worksheetsdelete_sheet - Remove worksheetsrename_sheet - Rename existing sheetsactivate_sheet - Switch active worksheetmove_sheet - Reorder sheet positionsset_sheet_display_status - Show/hide sheetsget_sheets - List all sheetsget_active_unit_id - Get current workbook ID🏗️ Structure Operations:
insert_rows / insert_columns - Add rows and columnsdelete_rows / delete_columns - Remove rows and columnsset_cell_dimensions - Adjust row heights and column widthsset_merge - Merge cell ranges🎨 Formatting & Styling:
set_range_style - Apply cell stylingadd_conditional_formatting_rule - Add conditional formattingset_conditional_formatting_rule - Update conditional formattingdelete_conditional_formatting_rule - Remove conditional formattingget_conditional_formatting_rules - List formatting rules✅ Data Validation:
add_data_validation_rule - Add validation rulesset_data_validation_rule - Update validation rulesdelete_data_validation_rule - Remove validation rulesget_data_validation_rules - List validation rules🔍 Utility Functions:
get_activity_status - Get workbook status and infoscroll_and_screenshot - Navigate and capture screenshots📈 Upcoming Features
git clone https://github.com/YOUR_USERNAME/univer-mcp-start-kit.git
cd univer-mcp-start-kit
Using pnpm (recommended):
# Install pnpm if you haven't already
npm install -g pnpm
# Install project dependencies
pnpm install
Using npm:
npm install
Create a .env file in the root directory for advanced features:
# Optional: Add your Univer license for advanced features
UNIVER_CLIENT_LICENSE=your_license_key_here
# Using pnpm
pnpm dev
# Using npm
npm run dev
The application will start at http://localhost:5173 by default.
If you want to add MCP functionality to an existing Univer project, follow these steps:
# Core MCP packages
pnpm add @univerjs-pro/mcp @univerjs-pro/mcp-ui @univerjs-pro/sheets-mcp
# Or using npm
npm install @univerjs-pro/mcp @univerjs-pro/mcp-ui @univerjs-pro/sheets-mcp
Add the following to your main setup file:
import { UniverMCPPlugin } from '@univerjs-pro/mcp'
import { UniverMCPUIPlugin } from '@univerjs-pro/mcp-ui'
// language files
import univerMCPUIEnUS from '@univerjs-pro/mcp-ui/locale/en-US'
import { UniverSheetMCPPlugin } from '@univerjs-pro/sheets-mcp'
// Import CSS
import '@univerjs-pro/mcp-ui/lib/index.css'
// Register plugins with your Univer instance
univer.registerPlugin(UniverMCPPlugin)
univer.registerPlugin(UniverMCPUIPlugin, {
showDeveloperTools: true, // Enable developer tools
})
univer.registerPlugin(UniverSheetMCPPlugin)
Make sure to expose the Univer API for MCP to access:
// Make univerAPI available globally for MCP
window.univerAPI = univerAPI
Add the Univer plugin to your vite.config.ts:
import { univerPlugin } from '@univerjs/vite-plugin'
export default defineConfig({
plugins: [
univerPlugin(),
// your other plugins
],
define: {
'process.env.UNIVER_CLIENT_LICENSE': `"${env.UNIVER_CLIENT_LICENSE}"`,
},
})
Here's a complete example of integrating MCP into a basic Univer setup:
import { UniverMCPPlugin } from '@univerjs-pro/mcp'
import { UniverMCPUIPlugin } from '@univerjs-pro/mcp-ui'
// omit more imports for brevity
import univerMCPUIEnUS from '@univerjs-pro/mcp-ui/locale/en-US'
import { UniverSheetMCPPlugin } from '@univerjs-pro/sheets-mcp'
import { createUniver, LocaleType, LogLevel } from '@univerjs/presets'
import { UniverSheetsCorePreset } from '@univerjs/presets/preset-sheets-core'
import sheetsCoreEnUs from '@univerjs/presets/preset-sheets-core/locales/en-US'
import '@univerjs-pro/mcp-ui/lib/index.css'
const { univerAPI, univer } = createUniver({
locale: LocaleType.EN_US,
logLevel: LogLevel.VERBOSE,
locales: {
[LocaleType.EN_US]: merge(
{},
sheetsCoreEnUs,
univerMCPUIEnUS,
),
},
presets: [
UniverSheetsCorePreset({
container: 'univer-container',
}),
],
plugins: [
UniverMCPPlugin,
[UniverMCPUIPlugin, { showDeveloperTools: true }],
UniverSheetMCPPlugin,
],
})
// Expose API for MCP
window.univerAPI = univerAPI
// Create initial workbook
univer.createUnit(UniverInstanceType.UNIVER_SHEET, {})
A: No, this kit works with the open-source version of Univer. However, an optional license unlocks advanced features and removes limitations. You can get a 30-day trial license for free.
A: Visit https://univer.ai/license to get a free 30-day trial license for advanced features.
A: Ensure that:
window.univerAPI is correctly exposedshowDeveloperTools: true (for debugging)A: Yes! This kit implements the Model Context Protocol (MCP) standard, making it compatible with any MCP-compatible AI application or framework.
We welcome contributions! Here's how you can help:
This project is licensed under the Apache 2.0 License.
Made with ❤️ by the Univer Community
TypeScript
92.8%
HTML
5.0%
CSS
2.2%
🚀 Automate spreadsheet tasks with AI. Connect the powerful Univer office suite to any MCP-compatible AI application. This kit provides everything you need to get started: configuration examples to handle Univer's sheets over MCP.
See the code🚀 Automate spreadsheet tasks with AI powered by Univer and Model Context Protocol (MCP)
This starter kit provides a seamless integration between Univer - a powerful open-source office suite engine - and Model Context Protocol (MCP), enabling AI applications to interact with spreadsheets, documents, and presentations through a standardized interface.
This kit integrates several key Univer components:
Univer MCP enables AI applications to interact with spreadsheets through the Model Context Protocol. The architecture includes MCP hosts (like Cursor, Claude), Univer MCP Server, mcp-bridge plugin, and the Univer instance.
📖 For complete architecture details and implementation guide, visit the Univer MCP Repository.
Note: Univer MCP is currently in early development. Chart generation and advanced visualizations will be supported in future releases. We welcome your feedback and feature requests!
This starter kit provides the following MCP tools for AI applications:
📊 Data Operations:
set_range_data - Set values in cell rangesget_range_data - Read cell values and datasearch_cells - Search for specific content in cellsauto_fill - Auto-fill data patternsformat_brush - Copy and apply cell formatting📋 Sheet Management:
create_sheet - Create new worksheetsdelete_sheet - Remove worksheetsrename_sheet - Rename existing sheetsactivate_sheet - Switch active worksheetmove_sheet - Reorder sheet positionsset_sheet_display_status - Show/hide sheetsget_sheets - List all sheetsget_active_unit_id - Get current workbook ID🏗️ Structure Operations:
insert_rows / insert_columns - Add rows and columnsdelete_rows / delete_columns - Remove rows and columnsset_cell_dimensions - Adjust row heights and column widthsset_merge - Merge cell ranges🎨 Formatting & Styling:
set_range_style - Apply cell stylingadd_conditional_formatting_rule - Add conditional formattingset_conditional_formatting_rule - Update conditional formattingdelete_conditional_formatting_rule - Remove conditional formattingget_conditional_formatting_rules - List formatting rules✅ Data Validation:
add_data_validation_rule - Add validation rulesset_data_validation_rule - Update validation rulesdelete_data_validation_rule - Remove validation rulesget_data_validation_rules - List validation rules🔍 Utility Functions:
get_activity_status - Get workbook status and infoscroll_and_screenshot - Navigate and capture screenshots📈 Upcoming Features
git clone https://github.com/YOUR_USERNAME/univer-mcp-start-kit.git
cd univer-mcp-start-kit
Using pnpm (recommended):
# Install pnpm if you haven't already
npm install -g pnpm
# Install project dependencies
pnpm install
Using npm:
npm install
Create a .env file in the root directory for advanced features:
# Optional: Add your Univer license for advanced features
UNIVER_CLIENT_LICENSE=your_license_key_here
# Using pnpm
pnpm dev
# Using npm
npm run dev
The application will start at http://localhost:5173 by default.
If you want to add MCP functionality to an existing Univer project, follow these steps:
# Core MCP packages
pnpm add @univerjs-pro/mcp @univerjs-pro/mcp-ui @univerjs-pro/sheets-mcp
# Or using npm
npm install @univerjs-pro/mcp @univerjs-pro/mcp-ui @univerjs-pro/sheets-mcp
Add the following to your main setup file:
import { UniverMCPPlugin } from '@univerjs-pro/mcp'
import { UniverMCPUIPlugin } from '@univerjs-pro/mcp-ui'
// language files
import univerMCPUIEnUS from '@univerjs-pro/mcp-ui/locale/en-US'
import { UniverSheetMCPPlugin } from '@univerjs-pro/sheets-mcp'
// Import CSS
import '@univerjs-pro/mcp-ui/lib/index.css'
// Register plugins with your Univer instance
univer.registerPlugin(UniverMCPPlugin)
univer.registerPlugin(UniverMCPUIPlugin, {
showDeveloperTools: true, // Enable developer tools
})
univer.registerPlugin(UniverSheetMCPPlugin)
Make sure to expose the Univer API for MCP to access:
// Make univerAPI available globally for MCP
window.univerAPI = univerAPI
Add the Univer plugin to your vite.config.ts:
import { univerPlugin } from '@univerjs/vite-plugin'
export default defineConfig({
plugins: [
univerPlugin(),
// your other plugins
],
define: {
'process.env.UNIVER_CLIENT_LICENSE': `"${env.UNIVER_CLIENT_LICENSE}"`,
},
})
Here's a complete example of integrating MCP into a basic Univer setup:
import { UniverMCPPlugin } from '@univerjs-pro/mcp'
import { UniverMCPUIPlugin } from '@univerjs-pro/mcp-ui'
// omit more imports for brevity
import univerMCPUIEnUS from '@univerjs-pro/mcp-ui/locale/en-US'
import { UniverSheetMCPPlugin } from '@univerjs-pro/sheets-mcp'
import { createUniver, LocaleType, LogLevel } from '@univerjs/presets'
import { UniverSheetsCorePreset } from '@univerjs/presets/preset-sheets-core'
import sheetsCoreEnUs from '@univerjs/presets/preset-sheets-core/locales/en-US'
import '@univerjs-pro/mcp-ui/lib/index.css'
const { univerAPI, univer } = createUniver({
locale: LocaleType.EN_US,
logLevel: LogLevel.VERBOSE,
locales: {
[LocaleType.EN_US]: merge(
{},
sheetsCoreEnUs,
univerMCPUIEnUS,
),
},
presets: [
UniverSheetsCorePreset({
container: 'univer-container',
}),
],
plugins: [
UniverMCPPlugin,
[UniverMCPUIPlugin, { showDeveloperTools: true }],
UniverSheetMCPPlugin,
],
})
// Expose API for MCP
window.univerAPI = univerAPI
// Create initial workbook
univer.createUnit(UniverInstanceType.UNIVER_SHEET, {})
A: No, this kit works with the open-source version of Univer. However, an optional license unlocks advanced features and removes limitations. You can get a 30-day trial license for free.
A: Visit https://univer.ai/license to get a free 30-day trial license for advanced features.
A: Ensure that:
window.univerAPI is correctly exposedshowDeveloperTools: true (for debugging)A: Yes! This kit implements the Model Context Protocol (MCP) standard, making it compatible with any MCP-compatible AI application or framework.
We welcome contributions! Here's how you can help:
This project is licensed under the Apache 2.0 License.
Made with ❤️ by the Univer Community
TypeScript
92.8%
HTML
5.0%
CSS
2.2%