A Model Context Protocol (MCP) server that provides data visualization and manipulation capabilities using AG Grid through headless browser automation. This server enables Claude to create, manipulate, and export data grids with advanced features like sorting, filtering, and statistical analysis.
- Grid Creation: Create AG Grid instances with custom column definitions and data
- Data Management: Update, filter, and sort grid data dynamically
- Export Functionality: Export grid data as CSV or Excel formats
- Statistical Analysis: Generate comprehensive data statistics and summaries
- Multi-Grid Support: Manage multiple grid instances simultaneously
- Resource Access: Expose grid data and metadata through MCP resources
- Headless Browser Automation: Uses Puppeteer for reliable grid rendering
- TypeScript: Fully typed with comprehensive error handling
- ES Modules: Modern JavaScript module system
- MCP Protocol: Native integration with Claude Desktop
- Sample Data: Realistic test datasets for sales, employee, and financial data
- Node.js 18+
- npm or yarn
- Chrome/Chromium browser (automatically handled by Puppeteer)
# Clone the repository
git clone <repository-url>
cd mcp-ag-grid
# Install dependencies
npm install
# Build the project
npm run build
# Test the installation
npm test# Install globally
npm install -g ag-grid-mcp-server
# Or install locally
npm install ag-grid-mcp-serverEdit your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"ag-grid": {
"command": "node",
"args": ["/path/to/mcp-ag-grid/build/server.js"],
"env": {
"NODE_ENV": "production"
}
}
}
}{
"mcpServers": {
"ag-grid": {
"command": "ag-grid-mcp-server"
}
}
}For development with source maps and debugging:
{
"mcpServers": {
"ag-grid": {
"command": "node",
"args": ["--enable-source-maps", "/path/to/mcp-ag-grid/build/server.js"],
"env": {
"NODE_ENV": "development",
"DEBUG": "*"
}
}
}
}Create a sales data grid with the following data:
- Product: iPhone 15, MacBook Pro, iPad Air
- Price: $999, $1999, $599
- Quantity: 10, 5, 15
- Revenue: calculated fieldThe server will create an AG Grid with sortable, filterable columns and return a grid ID for further operations.
Generate a statistical summary of the sales grid including:
- Total revenue
- Average price
- Best selling product
- Profit margins by productApply filters to show only:
- Products with revenue > $5000
- Sales from North America region
- Status = "completed"Export the filtered sales data as:
1. CSV format for spreadsheet analysis
2. Excel format with formattingCreate a new AG Grid instance with column definitions and data.
Parameters:
columnDefs: Array of column definitionsrowData: Array of data objectsgridOptions: Optional additional grid configuration
Update data in an existing grid.
Parameters:
gridId: Grid identifierrowData: New data to replace current data
Apply filters to a grid using AG Grid's filter model.
Parameters:
gridId: Grid identifierfilterModel: AG Grid filter configuration
Export grid data in specified format.
Parameters:
gridId: Grid identifierformat: "csv" or "excel"filename: Optional custom filename
Get comprehensive statistics and current state of a grid.
Parameters:
gridId: Grid identifier
Execute any AG Grid API method on a grid.
Parameters:
gridId: Grid identifiermethod: AG Grid API method nameparams: Optional method parameters
Lists all active grids with basic metadata.
Returns column definitions and data types for a specific grid.
Returns sample data from a grid (first 10 rows) for preview.
Returns comprehensive statistical analysis of grid data.
The server includes realistic sample datasets:
- Product information with categories
- Regional sales data
- Revenue and profit calculations
- Customer and sales rep information
- HR records with departments
- Salary and compensation data
- Performance ratings
- Manager hierarchies
- Transaction records
- Account balances
- Merchant and category information
- Credit/debit classifications
Generate sample data:
npm run sample-data# Start with auto-reload
npm run dev
# Start with debugging
npm run dev:debug
# Run tests in watch mode
npm run test:watch# Development build with source maps
npm run build
# Production build (optimized)
npm run build:prod
# Clean build directory
npm run clean# Run full test suite
npm test
# Run tests in development mode
npm run test:dev
# Validate code and run tests
npm run validateError: Could not find Chrome/Chromium
Solution: Install Chrome or set PUPPETEER_EXECUTABLE_PATH:
export PUPPETEER_EXECUTABLE_PATH=/path/to/chromeError: EACCES: permission denied
Solution: Ensure the server.js file is executable:
chmod +x build/server.jsError: Cannot find module
Solution: Ensure all dependencies are installed:
npm install
npm run buildCheck:
- Configuration file path is correct
- Server path in config is absolute
- No syntax errors in JSON config
- Restart Claude Desktop after config changes
Enable detailed logging:
DEBUG=* npm run devOr set environment variables:
{
"env": {
"DEBUG": "*",
"NODE_ENV": "development"
}
}For better performance:
- Use production build (
npm run build:prod) - Limit concurrent grid instances
- Use data sampling for large datasets
- Enable grid virtualization for large row counts
interface GridConfig {
columnDefs: ColumnDef[];
rowData: Record<string, any>[];
gridOptions?: Record<string, any>;
}
interface ColumnDef {
field: string;
headerName?: string;
width?: number;
type?: 'text' | 'number' | 'date' | 'boolean';
sortable?: boolean;
filter?: boolean;
resizable?: boolean;
}// Text filter
{
columnField: {
filterType: 'text',
type: 'contains',
filter: 'searchTerm'
}
}
// Number range filter
{
columnField: {
filterType: 'number',
type: 'inRange',
filter: 100,
filterTo: 500
}
}
// Date filter
{
columnField: {
filterType: 'date',
type: 'greaterThan',
dateFrom: '2023-01-01'
}
}- Fork the repository
- Create a feature branch
- Make changes with tests
- Run
npm run validate - Submit a pull request
ISC License - see LICENSE file for details.
For issues and questions:
- Create an issue on GitHub
- Check troubleshooting section
- Review AG Grid documentation for advanced features
Built with ❤️ for Claude Desktop integration
