How API7-MCP Helps You Eliminate Hidden API Risks
May 19, 2025
In the wave of digital transformation, APIs have become the core bridge between enterprise systems and external services. Their security, stability, and compliance are critical to ensuring business continuity and data protection. However, with the exponential growth and increasing complexity of APIs, enterprises are facing mounting challenges in API management and security—ranging from vulnerabilities and data leaks to service disruptions.
API7-MCP is a Model Context Protocol (MCP) server for connecting to the API7 Enterprise API. It empowers large language models (LLMs) to access and interpret a wide range of configuration data within the API gateway. Through this protocol, AI can retrieve API configurations, traffic metrics, and logs, enabling it to perform configuration analysis, permission audits, monitoring evaluations, and risk assessments.
The system can automatically detect a variety of potential issues, such as missing authentication plugins, weak authentication mechanisms, lack of enforced HTTPS, expiring SSL certificates, absence of rate limiting for sensitive APIs, exposure of sensitive data in logs, plugin conflicts, overly permissive access controls, and high-risk endpoints. By identifying these risks proactively, enterprises can significantly enhance the security and reliability of their API infrastructure.
This article provides an in-depth look at how API7-MCP performs risk detection across key areas, helping organizations build a more secure and resilient API ecosystem.
What Risk Detection Features Does API7-MCP Include?
1. Security and Authentication
- Security plugin configuration: Check configurations of routes, services, etc., analyze whether resources are configured with essential authentication plugins, and identify APIs not using necessary authentication plugins.
- Insufficient security of authentication plugin configuration: Evaluate the security level of authentication plugin configurations, focusing on aspects such as credential security, protocols and algorithms, verification mechanisms, validity periods and rotation, and handling of sensitive information.
2. Data Transmission
- API enforcement of HTTPS: Verify whether public routes and services are bound to SSL and prohibit plaintext HTTP external access.
- Security of SSL certificate configuration: Check SSL certificate expiration, encryption algorithms, certificate key lengths, etc., and identify idle SNI and certificates.
- Incompatible gateway instance versions: Determine if there are gateway instances with incompatible versions.
3. API Access and Rate Limiting Risks
- Rate limiting policies for sensitive APIs/routes: Analyze whether sensitive APIs have enabled rate limiting and evaluate the rationality of thresholds.
- Global protection mechanisms: Check if basic protection plugins are enabled and if critical business lines have additional protection.
- Route conflict detection: Determine if routes overlap or conflict.
- Health check configuration and node health status checks: Check if upstream health checks are enabled and analyze node health conditions.
4. Log and Audit Risks
- Log recording completeness: Check if core services and routes are configured with log recording plugins.
- Log leakage checks: Inspect log plugin configurations and analyze log content to identify sensitive information.
5. Plugin Management
- Plugin duplication: Analyze multiple plugins on the same request path and their priorities to identify logical conflicts.
- Potential risks of custom plugins: Perform static analysis on custom plugin/Serverless plugin code to identify risks and performance bottlenecks.
6. API Exposure and Sensitive Protection
- Risks of exposing sensitive/debugging/management interfaces: Identify dangerous endpoints and alert if strict access control is not enforced.
7. Role Management and Operational Compliance
- Permission granularity and the principle of least privilege: Check policy breadth, evaluate compliance with the least privilege principle, and identify redundant permissions and segregation of duties conflicts.
8. Monitoring and Alerts
- Abnormal traffic and resource usage detection: Obtain traffic and resource curves to identify abnormal situations.
- Request abnormality and error trend analysis: Check 5xx and 4xx situations and diagnose status code distribution patterns.
How to Use API7-MCP for Risk Detection?
Risk detection applies to various practical business scenarios, including API security checks, architecture compliance audits, DevSecOps security integration, production environment stability assurance, and regulatory compliance responses.
To start risk detection, first configure the AI client. Then, issue instructions to the AI client via natural language to request a risk assessment of the API7 Enterprise and generate a risk detection report. The AI client will call the built-in check_risk
tool of API7-MCP to detect risks across multiple dimensions of the API7 Enterprise, including security, performance, and compliance.
In this process, the AI client collects various resource details from us regarding the API7 Enterprise, such as permission policies, roles, SSL certificates, CA certificates, gateway groups, gateway instances, plugins, health checks, and monitoring data. Based on the collected information, API7-MCP conducts an in-depth analysis and ultimately generates a comprehensive risk detection report. This report covers all aspects of the risk item detection functions mentioned above, providing enterprises with comprehensive risk insights.
Below is a reference example of a risk item detection report:
# API7 Risk Assessment Report ## Security & Authentication ### Overly Permissive Policies - **Result**: ⚠️ Warning - **Affected Resources**: - Policy: "iCRM admin policy" (e6aa0908-1a5e-4fbc-851b-682f3ed7f24a) - Policy: "super-admin-permission-policy" (super-admin-permission-policy) - **Recommendation**: - Replace wildcard actions ("*") with specific required actions - Implement more granular permissions following the principle of least privilege - Review and restrict the super-admin policy to only necessary resources and actions ### Authentication Plugin Configuration - **Result**: ⚠️ Warning - **Affected Resources**: - Gateway Group: "default" - Gateway Group: "icrm" - **Recommendation**: - Implement authentication plugins (e.g., key-auth, jwt-auth) for all routes - Ensure all sensitive APIs have proper authentication mechanisms ## Data Transmission ### HTTPS Enforcement - **Result**: ❌ Critical - **Affected Resources**: - Service: "httpbin" (27ecba8a-d741-48dc-8fda-40c8b605fe0d) using HTTP (port 80) - **Recommendation**: - Configure all services to use HTTPS instead of HTTP - Implement SSL certificates for secure communication - Set up proper SNI configurations ### SSL Certificate Security - **Result**: ⚠️ Warning - **Affected Resources**: - No SSL certificates configured for any gateway groups - **Recommendation**: - Implement SSL certificates for all public-facing services - Configure proper CA certificates and SNI settings - Ensure TLS 1.2+ is enforced for all secure communications ## Gateway Instance Health ### Gateway Instance Connectivity - **Result**: 🔴 High Risk - **Affected Resources**: - Gateway Instance: "82be548abaf2" (b6e4915d-758a-49c6-989b-5003c452fc2c) with status "LostConnection" - **Recommendation**: - Investigate and resolve the connectivity issues with the disconnected gateway instance - Implement proper monitoring and alerting for gateway instance status - Consider setting up automatic recovery procedures ## API Access & Rate Limiting ### Health Check Configuration - **Result**: ⚠️ Warning - **Affected Resources**: - Service: "mcp-test" (400b5c67-2a9b-4ac5-9aeb-0164823afdcb) with "unknown" health status - Service: "httpbin" (27ecba8a-d741-48dc-8fda-40c8b605fe0d) with "unknown" health status - **Recommendation**: - Configure and enable active health checks for all services - Set up proper monitoring for upstream health status - Implement fallback mechanisms for unhealthy nodes ### Rate Limiting - **Result**: ⚠️ Warning - **Affected Resources**: - All routes in gateway groups "default" and "icrm" - **Recommendation**: - Implement rate limiting plugins (limit-req, limit-count) for all routes - Apply stricter rate limits for sensitive operations - Configure different rate limits based on consumer tiers ## Monitoring & Error Rates ### High Error Rate - **Result**: 🔴 Critical - **Affected Resources**: - Gateway Group: "default" with 72.24% 502 errors and 27.76% 404 errors - Nearly 100% of requests are failing (6001 failures out of 6000.97 total requests) - **Recommendation**: - Urgently investigate the cause of the high error rates - Check upstream service availability and connectivity - Review route configurations and ensure they point to valid endpoints - Implement circuit breakers to prevent cascading failures ### Traffic Monitoring - **Result**: ⚠️ Warning - **Affected Resources**: - Gateway Group: "icrm" with no traffic data - **Recommendation**: - Verify if the icrm gateway group is properly configured and expected to receive traffic - Set up proper monitoring and alerting for traffic patterns - Implement baseline metrics and anomaly detection ## Summary of Critical Issues 1. **High Priority**: - Resolve the 502/404 error rates in the default gateway group (72.24% 502 errors) - Enforce HTTPS for all services, especially the httpbin service currently using HTTP - Restore connectivity to the disconnected gateway instance 2. **Medium Priority**: - Implement proper authentication for all routes - Configure rate limiting for API protection - Set up active health checks for all services 3. **Ongoing Improvements**: - Review and refine permission policies to follow least privilege principle - Implement comprehensive monitoring and alerting - Regularly audit and update security configurations This report highlights significant security and operational risks that require immediate attention. Addressing these issues will improve the security, reliability, and performance of your API7 gateway infrastructure.
Summary
By configuring API7-MCP, users can easily evaluate API risks and generate detailed detection reports. API7-MCP identifies potential issues across multiple key dimensions, including security and authentication, data transmission, access control and rate limiting, log auditing, plugin usage, API exposure and sensitive information protection, role permission management, operational compliance, and monitoring and alerts.
It not only pinpoints affected resources but also offers targeted improvement suggestions, such as optimizing permission policies, enabling authentication plugins, enforcing HTTPS, or configuring route rate limiting strategies, helping prevent security incidents.
API7-MCP provides enterprises with an efficient and actionable API risk identification and governance solution, aiding in the construction of a more secure and stable API system to actively address the increasingly complex challenges of API management and security.