A comprehensive Node.js Model Context Protocol (MCP) server for JasperReports Server REST API v2. This server enables AI assistants and developers to perform all major JasperReports operations including authentication, resource management, report execution, job scheduling, and administrative tasks through standardized MCP tools.
Perfect for integrating JasperReports functionality into AI-powered IDEs like Cursor, Kiro, Windsurf, Claude Desktop, and any other MCP-compatible development environment.
- π MCP Compatible: Works seamlessly with Cursor, Kiro, Windsurf, and other MCP-enabled IDEs
- π Complete JasperReports Integration: Full support for JasperReports Server REST API v2
- π Multiple Authentication Methods: Basic, login service, and argument-based authentication
- π Resource Management: Upload, list, update, and delete reports and resources
- π Report Execution: Synchronous and asynchronous report generation in multiple formats (PDF, Excel, CSV, etc.)
- β° Job Scheduling: Create and manage scheduled report jobs with cron expressions
- ποΈ Input Controls: Handle report parameters and cascading controls
- π₯ Administrative Tools: User, role, and permission management
- π§ͺ Test Server: HTTP endpoint for testing and validation
- π‘οΈ Enterprise Ready: SSL support, timeout handling, and comprehensive error management
- π Comprehensive Logging: Debug and production logging with configurable levels
- Install the MCP server globally:
npm install -g jasperreports-mcp-server
- Add to your Cursor settings (
.cursor-settings/mcp.json
):
{
"mcpServers": {
"jasperreports-server": {
"command": "npx",
"args": ["jasperreports-mcp-server"],
"env": {
"JASPER_URL": "http://localhost:8080/jasperserver",
"JASPER_USERNAME": "jasperadmin",
"JASPER_PASSWORD": "jasperadmin",
"JASPER_AUTH_TYPE": "basic"
}
}
}
}
- Install the server:
npm install -g jasperreports-mcp-server
- Configure in
.kiro/settings/mcp.json
:
{
"mcpServers": {
"jasperreports-server": {
"command": "jasperreports-mcp-server",
"env": {
"JASPER_URL": "http://localhost:8080/jasperserver",
"JASPER_USERNAME": "jasperadmin",
"JASPER_PASSWORD": "jasperadmin"
},
"autoApprove": [
"jasper_authenticate",
"jasper_test_connection",
"jasper_list_resources"
]
}
}
}
- Install globally:
npm install -g jasperreports-mcp-server
- Add to Windsurf MCP configuration:
{
"mcpServers": {
"jasperreports-server": {
"command": "npx",
"args": ["jasperreports-mcp-server"],
"env": {
"JASPER_URL": "https://your-jasper-server.com/jasperserver",
"JASPER_USERNAME": "your-username",
"JASPER_PASSWORD": "your-password",
"JASPER_SSL_VERIFY": "true"
}
}
}
}
- Install the server:
npm install -g jasperreports-mcp-server
- Add to your Claude Desktop configuration (
~/Library/Application Support/Claude/claude_desktop_config.json
on macOS):
{
"mcpServers": {
"jasperreports-server": {
"command": "jasperreports-mcp-server",
"env": {
"JASPER_URL": "http://localhost:8080/jasperserver",
"JASPER_USERNAME": "jasperadmin",
"JASPER_PASSWORD": "jasperadmin"
}
}
}
}
For any IDE that supports the Model Context Protocol:
- Install the server:
npm install -g jasperreports-mcp-server
- Add the server configuration to your IDE's MCP settings file:
{
"mcpServers": {
"jasperreports-server": {
"command": "jasperreports-mcp-server",
"env": {
"JASPER_URL": "your-jasper-server-url",
"JASPER_USERNAME": "your-username",
"JASPER_PASSWORD": "your-password"
}
}
}
}
- Clone and install:
git clone https://github.com/mr-wolf-gb/jasperreports-mcp-server.git
cd jasperreports-mcp-server
npm install
- Configure environment variables:
cp .env.example .env
# Edit .env with your JasperReports Server details
- Start the server:
# Start the MCP server
npm start
# Start in development mode with auto-reload
npm run dev
# Start the test server for HTTP testing
npm run test-server
# Install globally
npm install -g jasperreports-mcp-server
# Or use with npx (recommended)
npx jasperreports-mcp-server
src/
βββ config/ # Configuration management
βββ services/ # Business logic services
βββ utils/ # Utility functions
βββ models/ # Data models and schemas
βββ tools/ # MCP tool definitions
βββ index.js # Main MCP server entry point
βββ testServer.js # Express test server
test/
βββ unit/ # Unit tests
βββ integration/ # Integration tests
βββ fixtures/ # Test data and fixtures
βββ utils/ # Test utilities
docs/ # Documentation and examples
npm start
- Start the MCP servernpm run dev
- Start with auto-reloadnpm test
- Run all testsnpm run test:watch
- Run tests in watch modenpm run test:coverage
- Run tests with coverage reportnpm run lint
- Run ESLintnpm run lint:fix
- Fix ESLint issuesnpm run format
- Format code with Prettiernpm run format:check
- Check code formattingnpm run test-server
- Start HTTP test server
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watch
The server is configured through environment variables:
Variable | Description | Default | Required |
---|---|---|---|
JASPER_URL |
JasperReports Server URL | - | β |
JASPER_USERNAME |
Username for authentication | - | β |
JASPER_PASSWORD |
Password for authentication | - | β |
JASPER_AUTH_TYPE |
Authentication method (basic/login/argument) | basic | β |
JASPER_ORGANIZATION |
Organization for multi-tenant setups | - | β |
JASPER_TIMEOUT |
Request timeout in milliseconds | 30000 | β |
JASPER_DEBUG_MODE |
Enable debug logging | false | β |
JASPER_SSL_VERIFY |
Verify SSL certificates | true | β |
TEST_SERVER_PORT |
Port for HTTP test server | 3000 | β |
TEST_SERVER_ENABLED |
Enable HTTP test server | false | β |
NODE_ENV |
Node.js environment | production | β |
LOG_LEVEL |
Logging level (error/warn/info/debug) | info | β |
The config/
directory contains ready-to-use MCP configuration examples:
mcp-development.json
: Local development with debug loggingmcp-production.json
: Production setup with security best practicesmcp-docker.json
: Docker-based deployment configuration
Copy the appropriate configuration to your IDE's MCP settings and customize the environment variables.
The server provides 40+ MCP tools organized into logical categories:
jasper_authenticate
- Authenticate with JasperReports Serverjasper_test_connection
- Test server connectivity and health
jasper_upload_resource
- Upload JRXML reports and resourcesjasper_list_resources
- List repository resources with filteringjasper_get_resource
- Retrieve resource details and contentjasper_update_resource
- Update existing resourcesjasper_delete_resource
- Delete resources and folders
jasper_run_report_sync
- Execute reports synchronously (PDF, Excel, CSV, etc.)jasper_run_report_async
- Start asynchronous execution for large reportsjasper_get_execution_status
- Check execution status and progressjasper_get_execution_result
- Retrieve execution results and filesjasper_cancel_execution
- Cancel running executions
jasper_create_job
- Create scheduled jobs with cron expressionsjasper_list_jobs
- List existing jobs with filteringjasper_update_job
- Modify job schedules and parametersjasper_delete_job
- Remove scheduled jobsjasper_run_job_now
- Execute jobs immediately
jasper_get_input_controls
- Get report parameters and controlsjasper_set_input_control_values
- Set parameter values for cascading controlsjasper_validate_input_controls
- Validate parameter values
jasper_create_user
- Create new user accountsjasper_list_users
- List users with filteringjasper_update_user
- Update user details and rolesjasper_create_role
- Create new rolesjasper_list_roles
- List available roles
jasper_get_permissions
- Get resource permissionsjasper_set_permissions
- Set resource permissions for users/roles
jasper_list_domains
- List semantic layer domainsjasper_get_domain
- Get domain definitionsjasper_get_domain_schema
- Get domain schema and fields
jasper_get_report_template
- Get JRXML report templatesjasper_get_datasource_structure
- Get datasource configuration templates
jasper_health_status
- Get comprehensive health statusjasper_deep_health_check
- Perform deep system health checksjasper_performance_metrics
- Get performance and memory metricsjasper_component_health
- Test specific system componentsjasper_resilience_stats
- Get resilience and retry statistics
// Authenticate first
await jasper_authenticate({
username: "jasperadmin",
password: "jasperadmin"
});
// List available reports
const reports = await jasper_list_resources({
folderUri: "/reports",
resourceType: "reportUnit"
});
// Execute a report
const result = await jasper_run_report_sync({
reportUri: "/reports/SampleReport",
outputFormat: "pdf",
parameters: {
"StartDate": "2024-01-01",
"EndDate": "2024-12-31"
}
});
// Upload a new report
await jasper_upload_resource({
resourcePath: "/reports/MyReport",
label: "My Custom Report",
jrxmlContent: "<?xml version='1.0'?>...",
resourceType: "reportUnit"
});
// Create a scheduled job
await jasper_create_job({
label: "Daily Sales Report",
reportUri: "/reports/MyReport",
schedule: {
type: "simple",
recurrenceInterval: 1,
recurrenceIntervalUnit: "DAY"
},
outputFormats: ["pdf", "xlsx"],
recipients: ["[email protected]"]
});
# Build the image
docker build -t jasperreports-mcp-server .
# Run with environment file
docker run -p 3000:3000 --env-file .env jasperreports-mcp-server
# Or use docker-compose for development
docker-compose up --build
Use the provided config/mcp-docker.json
for Docker-based MCP setup:
{
"mcpServers": {
"jasperreports-server": {
"command": "docker",
"args": [
"run", "--rm", "--network=host",
"--env-file", ".env",
"jasperreports-mcp-server"
]
}
}
}
Connection Refused
- Verify
JASPER_URL
is correct and accessible - Check if JasperReports Server is running
- Ensure network connectivity
Authentication Failed
- Verify username and password
- Check if the user account is enabled
- Try different authentication methods (
basic
,login
,argument
)
SSL Certificate Errors
- Set
JASPER_SSL_VERIFY=false
for development - Install proper SSL certificates for production
- Use HTTP instead of HTTPS for local development
Tool Not Found
- Ensure the MCP server is properly configured in your IDE
- Check that the server is running and accessible
- Verify environment variables are set correctly
Enable debug logging for troubleshooting:
export JASPER_DEBUG_MODE=true
export LOG_LEVEL=debug
Use the built-in health check tools:
// Test basic connectivity
await jasper_test_connection();
// Comprehensive health check
await jasper_deep_health_check();
// Check specific components
await jasper_component_health({ component: "authentication" });
- π API Documentation
- π§ Configuration Guide
- π Deployment Guide
- π JRXML Examples
- π Troubleshooting Guide
- π‘ Comprehensive Examples
GPL-3.0-or-later License - see LICENSE file for details.
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Add tests for new functionality
- Ensure all tests pass (
npm test
) - Run linting (
npm run lint:fix
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
# Clone and install
git clone https://github.com/mr-wolf-gb/jasperreports-mcp-server.git
cd jasperreports-mcp-server
npm install
# Run tests
npm test
npm run test:coverage
# Start development server
npm run dev
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π Documentation: Full Documentation
- GraphQL API support
- WebSocket real-time updates
- Advanced caching mechanisms
- Multi-server load balancing
- Enhanced security features
- Visual report designer integration
Made with β€οΈ by Mr-Wolf-GB for the JasperReports and MCP community