Forjinn Docs

Development Platform

Documentation v2.0
Made with
by Forjinn

Mcp Integrations

Learn about mcp integrations and how to implement it effectively.

5 min read
🆕Recently updated
Last updated: 12/9/2025

MCP (Model Context Protocol) Integrations

Model Context Protocol (MCP) integrations provide standardized interfaces for AI agents to interact with external systems, databases, and services through a unified protocol.

Overview

MCP integrations in Forjinn enable:

  • Standardized tool interfaces across different systems
  • Secure, isolated execution environments
  • Dynamic tool discovery and loading
  • Consistent error handling and caching

Chrome MCP

Overview

Chrome MCP provides comprehensive browser automation capabilities, enabling AI agents to control Chrome browsers remotely with full debugging support.

Architecture

  • MCP Server: Uses @playwright/mcp for browser automation
  • Connection: WebSocket debugging protocol to Chrome
  • Security: Supports ngrok tunneling for remote access
  • Tools: 40+ browser automation tools available

Setup Instructions

Windows Setup

:: 1. Create persistent profile directory
mkdir %USERPROFILE%\chrome-profile

:: 2. Launch Chrome in headful mode
start "" "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="%USERPROFILE%\chrome-profile" --no-first-run --disable-default-apps

:: 3. Wait for Chrome to start
timeout /t 5

:: 4. Start ngrok tunnel
ngrok http 9222

Linux/macOS Setup

# 1. Create persistent profile directory
mkdir -p ~/chrome-profile

# 2. Launch Chrome in headful mode
google-chrome --remote-debugging-port=9222 --user-data-dir=~/chrome-profile --no-first-run --disable-default-apps &

# 3. Wait for Chrome to start
sleep 3

# 4. Start ngrok tunnel
ngrok http 9222

Available Tools

Navigation Tools

  • browser_navigate - Navigate to a URL
  • browser_navigate_back - Go back to previous page
  • browser_reload - Reload current page
  • browser_goto - Advanced navigation with options

Interaction Tools

  • browser_click - Click on elements
  • browser_fill - Fill form fields
  • browser_type - Type text into elements
  • browser_press_key - Press keyboard keys
  • browser_hover - Hover over elements
  • browser_drag - Drag and drop operations

Content Extraction

  • browser_get_content - Get page HTML content
  • browser_get_text - Extract text from elements
  • browser_get_attribute - Get element attributes
  • browser_get_property - Get element properties

Visual Tools

  • browser_take_screenshot - Capture screenshots
  • browser_full_page_screenshot - Full page screenshots
  • browser_element_screenshot - Screenshot specific elements

Form Handling

  • browser_select_option - Select dropdown options
  • browser_check - Check checkboxes
  • browser_uncheck - Uncheck checkboxes
  • browser_file_upload - Upload files

Advanced Features

  • browser_evaluate - Execute JavaScript
  • browser_add_script - Add script tags
  • browser_add_style - Add CSS styles
  • browser_set_viewport - Set viewport size
  • browser_emulate_media - Emulate media types

Network & Cookies

  • browser_set_extra_headers - Set HTTP headers
  • browser_set_cookie - Set cookies
  • browser_get_cookies - Get cookies
  • browser_clear_cookies - Clear cookies

Waiting & Synchronization

  • browser_wait_for_element - Wait for elements
  • browser_wait_for_navigation - Wait for page loads
  • browser_wait_for_timeout - Wait for specific time
  • browser_wait_for_function - Wait for JavaScript conditions

Security Considerations

  • Use authenticated ngrok tunnels: ngrok http 9222 --basic-auth="username:password"
  • Never use personal Chrome profile for debugging
  • Consider Cloudflare Tunnel for production environments
  • Implement proper firewall rules for remote access

Database MCP Integrations

MySQL MCP

Features:

  • Full CRUD operations
  • Schema introspection
  • Query execution
  • Connection pooling
  • SSL support

Available Tools:

  • mysql_query - Execute SQL queries
  • mysql_describe_table - Get table schema
  • mysql_list_tables - List all tables
  • mysql_insert - Insert records
  • mysql_update - Update records
  • mysql_delete - Delete records

Configuration:

{
  host: "localhost",
  port: "3306",
  user: "username",
  password: "password",
  database: "database_name"
}

PostgreSQL MCP

Features:

  • Advanced SQL support (CTEs, window functions)
  • JSON/JSONB operations
  • Full-text search capabilities
  • Read-only mode for safety
  • Connection URL support

Available Tools:

  • postgres_query - Execute SELECT queries
  • postgres_describe_table - Get table information
  • postgres_list_tables - List tables and views
  • postgres_get_schema - Get database schema
  • postgres_explain - Explain query execution plans

Configuration:

{
  postgresUrl: "postgresql://user:password@host:port/database"
}

MSSQL MCP

Features:

  • Full T-SQL support
  • Windows Authentication support
  • Stored procedure execution
  • Bulk operations
  • TLS/SSL encryption

Available Tools:

  • mssql_query - Execute T-SQL queries
  • mssql_execute_procedure - Execute stored procedures
  • mssql_get_tables - List tables and views
  • mssql_get_columns - Get column information
  • mssql_bulk_insert - Bulk data operations

Configuration:

{
  serverName: "server.domain.com",
  databaseName: "database_name",
  username: "username",
  password: "password"
}

MongoDB MCP

Features:

  • Document CRUD operations
  • Aggregation pipeline support
  • Index management
  • Collection operations
  • Read-only mode

Available Tools:

  • mongodb_find - Find documents
  • mongodb_aggregate - Run aggregation pipelines
  • mongodb_count - Count documents
  • mongodb_distinct - Get distinct values
  • mongodb_list_collections - List collections
  • mongodb_get_indexes - Get collection indexes

Configuration:

{
  connectionString: "mongodb://user:password@host:port/database"
}

Common MCP Features

Caching System

MCP integrations implement intelligent caching to improve performance:

  • Tool definitions cached for 5-30 minutes
  • Connection pooling for database MCPs
  • Automatic cache invalidation on errors

Error Handling

Robust error handling across all MCP integrations:

  • Graceful degradation on connection failures
  • Detailed error messages for debugging
  • Automatic retry mechanisms
  • Fallback to empty tool arrays when needed

Security

  • Credential encryption and secure storage
  • Connection string validation
  • SQL injection prevention
  • Resource limits and timeouts

Best Practices

  1. Connection Management: Use connection pooling for database MCPs
  2. Security: Always use encrypted connections in production
  3. Error Handling: Implement proper error handling in workflows
  4. Monitoring: Monitor MCP tool performance and availability
  5. Caching: Leverage built-in caching for better performance
  6. Testing: Test MCP integrations thoroughly before deployment

Troubleshooting

Common Issues

  1. Connection failures: Check network connectivity and credentials
  2. Tool loading errors: Verify MCP server availability
  3. Permission errors: Ensure proper database/service permissions
  4. Timeout issues: Adjust timeout settings for slow operations

Debug Steps

  1. Check MCP server logs
  2. Verify credential configuration
  3. Test connections manually
  4. Review network and firewall settings
  5. Monitor resource usage and limits