Repository Analysis

samanhappy/mcphub

A unified hub for centrally managing and dynamically orchestrating multiple MCP servers/APIs into separate endpoints with flexible routing strategies.

3.4 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of samanhappy/mcphub, a TypeScript project with 2,225 GitHub stars. SynthScan v2.0 examined 117,692 lines of code across 524 source files, recording 165 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 3.4 places this repository in the Likely human-written band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

3.4
Adjusted Score
3.4
Raw Score
100%
Time Factor
2026-07-13
Last Push
2.2K
Stars
TypeScript
Language
117.7K
Lines of Code
524
Files
165
Pattern Hits
2026-07-14
Scan Date
0.03
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 3HIGH 11MEDIUM 54LOW 97

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 165 distinct pattern matches across 8 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Decorative Section Separators54 hits · 170 pts
SeverityFileLineSnippetContext
MEDIUMtests/dao/userDaoDbImpl.test.ts1// ── Mock UserRepository ───────────────────────────────────────────COMMENT
MEDIUMtests/dao/userDaoDbImpl.test.ts41 // ── findBySsoUserId ──────────────────────────────────────────COMMENT
MEDIUMtests/dao/userDaoDbImpl.test.ts67 // ── toIUser mapping ─────────────────────────────────────────COMMENT
MEDIUMtests/dao/userDaoDbImpl.test.ts111 // ── create with ssoUserId ───────────────────────────────────COMMENT
MEDIUMtests/dao/userDaoDbImpl.test.ts146 // ── createWithHashedPassword with ssoUserId ─────────────────COMMENT
MEDIUMtests/dao/userDaoDbImpl.test.ts165 // ── update with ssoUserId ───────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts17// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts19// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts78// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts80// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts117// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts119// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts145// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts147// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts181// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts183// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts260// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts262// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts272// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts274// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts292// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts294// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts454// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts456// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts506// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/utils/tokenTruncation.test.ts508// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/controllers/userController.test.ts3// ── Mock service layer ───────────────────────────────────────────COMMENT
MEDIUMtests/controllers/userController.test.ts55 // ── createUser ───────────────────────────────────────────────COMMENT
MEDIUMtests/controllers/userController.test.ts109 // ── updateExistingUser ───────────────────────────────────────COMMENT
MEDIUMtests/services/userService.test.ts1// ── Mock DAO layer ────────────────────────────────────────────────COMMENT
MEDIUMtests/services/userService.test.ts41 // ── createNewUser ────────────────────────────────────────────COMMENT
MEDIUMtests/services/userService.test.ts90 // ── updateUser ───────────────────────────────────────────────COMMENT
MEDIUMtests/services/userService.test.ts141 // ── deleteUser ───────────────────────────────────────────────COMMENT
MEDIUMtests/services/betterAuthSession.test.ts3// ── Mock DAO layer ────────────────────────────────────────────────COMMENT
MEDIUMtests/services/betterAuthSession.test.ts20// ── Mock Better Auth runtime config ──────────────────────────────COMMENT
MEDIUMtests/services/betterAuthSession.test.ts27// ── Mock Better Auth modules (used by getBetterAuthSession) ──────COMMENT
MEDIUMtests/services/betterAuthSession.test.ts45 // ── Priority 1: ssoUserId match ──────────────────────────────COMMENT
MEDIUMtests/services/betterAuthSession.test.ts104 // ── Priority 2: email match (legacy fallback) ────────────────COMMENT
MEDIUMtests/services/betterAuthSession.test.ts162 // ── Priority 3: username match (backward compat) ─────────────COMMENT
MEDIUMtests/services/betterAuthSession.test.ts219 // ── Priority 4: create new user ──────────────────────────────COMMENT
MEDIUMtests/services/betterAuthSession.test.ts282 // ── Session edge cases ───────────────────────────────────────COMMENT
MEDIUMsrc/types/index.ts759// ─── Context Footprint (token cost) feature ───────────────────────────────COMMENT
MEDIUMsrc/utils/tokenTruncation.ts50// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/utils/tokenTruncation.ts52// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/utils/tokenTruncation.ts73// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/utils/tokenTruncation.ts75// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/utils/tokenTruncation.ts98// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/utils/tokenTruncation.ts100// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/utils/tokenTruncation.ts350// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/utils/tokenTruncation.ts352// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/utils/tokenTruncation.ts415// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/utils/tokenTruncation.ts417// ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/services/vectorSearchService.ts1145 // ── Phase 1: Generate all embeddings in memory (no DB access) ──────────────COMMENT
MEDIUMsrc/services/vectorSearchService.ts1216 // ── Phase 2: Persist embeddings to DB ──────────────────────────────────────COMMENT
Magic Placeholder Names11 hits · 55 pts
SeverityFileLineSnippetContext
HIGHmcp_settings.json10 "AMAP_MAPS_API_KEY": "your-api-key"CODE
HIGHarticals/intro2.md60 "AMAP_MAPS_API_KEY": "your-api-key"CODE
HIGHfrontend/src/components/ServerForm.tsx617 placeholder="your-api-key"CODE
HIGHtests/cli/commands/install.test.ts34 env: { AMAP_MAPS_API_KEY: '<your-api-key>' },CODE
HIGHtests/cli/commands/install.test.ts38 AMAP_MAPS_API_KEY: { description: 'AMap API key', required: true, example: '<your-api-key>' },CODE
HIGHexamples/openapi-schema-config.json13 "value": "your-api-key-here"CODE
HIGHexamples/openapi-schema-config.json246 "value": "your-api-key-here"CODE
HIGHsrc/services/vectorSearchService.ts40 ` -H "Authorization: Bearer <YOUR_API_KEY>"`,CODE
HIGHsrc/services/vectorSearchService.ts40 ` -H "Authorization: Bearer <YOUR_API_KEY>"`,CODE
HIGHsrc/services/vectorSearchService.ts800 `[Embedding] Reproducible curl (copy/paste and replace <YOUR_API_KEY>):\n${debugCurl}`,CODE
HIGHsrc/services/vectorSearchService.ts800 `[Embedding] Reproducible curl (copy/paste and replace <YOUR_API_KEY>):\n${debugCurl}`,CODE
Verbosity Indicators22 hits · 41 pts
SeverityFileLineSnippetContext
LOWsrc/config/migrationUtils.ts63 // Step 1: Backup current dataCOMMENT
LOWsrc/config/migrationUtils.ts68 // Step 2: Perform migrationCOMMENT
LOWsrc/config/migrationUtils.ts77 // Step 3: Validate migrationCOMMENT
LOWsrc/scripts/dao-demo.ts128 // Step 1: Show current configurationCOMMENT
LOWsrc/scripts/dao-demo.ts140 // Step 2: Switch to DAO and show same dataCOMMENT
LOWsrc/scripts/dao-demo.ts154 // Step 3: Demonstrate CRUD operationsCOMMENT
LOWsrc/scripts/dao-demo.ts218 // Step 4: Show benefitsCOMMENT
LOWsrc/db/connection.ts277 // Step 1: Drop any existing index on the columnCOMMENT
LOWsrc/db/connection.ts284 // Step 2: Ensure embedding column exists and uses vector typeCOMMENT
LOWsrc/db/connection.ts292 // Step 3: Try to create appropriate indicesCOMMENT
LOWsrc/services/oauthClientRegistration.ts158 // Step 1: Parse WWW-Authenticate header to get resource metadata URLCOMMENT
LOWsrc/services/oauthClientRegistration.ts166 // Step 2: Fetch protected resource metadataCOMMENT
LOWsrc/services/oauthClientRegistration.ts169 // Step 3: Select first authorization server (TODO: implement proper selection logic)COMMENT
LOWsrc/services/oauthClientRegistration.ts176 // Step 4: Determine resource URL (canonical URI of MCP server)COMMENT
LOWsrc/services/oauthClientRegistration.ts179 // Step 5: Extract supported scopes from resource metadataCOMMENT
LOWsrc/services/oauthClientRegistration.ts238 // Step 1: Determine the authorization server URLCOMMENT
LOWsrc/services/oauthClientRegistration.ts254 // Step 2: Prepare client metadata for registrationCOMMENT
LOWsrc/services/oauthClientRegistration.ts289 // Step 3: Perform dynamic client registrationCOMMENT
LOWsrc/services/oauthClientRegistration.ts302 // Step 4: Store registered client informationCOMMENT
LOWsrc/services/sseService.ts183 // Step 1: Try to match as a group (by name or id), since group has higher priorityCOMMENT
LOWsrc/services/sseService.ts242 // Step 2: Not a group, try to match as a server nameCOMMENT
LOWsrc/services/sseService.ts262 // Step 3: Not a valid group or server, deny accessCOMMENT
Structural Annotation Overuse22 hits · 41 pts
SeverityFileLineSnippetContext
LOWsrc/config/migrationUtils.ts63 // Step 1: Backup current dataCOMMENT
LOWsrc/config/migrationUtils.ts68 // Step 2: Perform migrationCOMMENT
LOWsrc/config/migrationUtils.ts77 // Step 3: Validate migrationCOMMENT
LOWsrc/scripts/dao-demo.ts128 // Step 1: Show current configurationCOMMENT
LOWsrc/scripts/dao-demo.ts140 // Step 2: Switch to DAO and show same dataCOMMENT
LOWsrc/scripts/dao-demo.ts154 // Step 3: Demonstrate CRUD operationsCOMMENT
LOWsrc/scripts/dao-demo.ts218 // Step 4: Show benefitsCOMMENT
LOWsrc/db/connection.ts277 // Step 1: Drop any existing index on the columnCOMMENT
LOWsrc/db/connection.ts284 // Step 2: Ensure embedding column exists and uses vector typeCOMMENT
LOWsrc/db/connection.ts292 // Step 3: Try to create appropriate indicesCOMMENT
LOWsrc/services/oauthClientRegistration.ts158 // Step 1: Parse WWW-Authenticate header to get resource metadata URLCOMMENT
LOWsrc/services/oauthClientRegistration.ts166 // Step 2: Fetch protected resource metadataCOMMENT
LOWsrc/services/oauthClientRegistration.ts169 // Step 3: Select first authorization server (TODO: implement proper selection logic)COMMENT
LOWsrc/services/oauthClientRegistration.ts176 // Step 4: Determine resource URL (canonical URI of MCP server)COMMENT
LOWsrc/services/oauthClientRegistration.ts179 // Step 5: Extract supported scopes from resource metadataCOMMENT
LOWsrc/services/oauthClientRegistration.ts238 // Step 1: Determine the authorization server URLCOMMENT
LOWsrc/services/oauthClientRegistration.ts254 // Step 2: Prepare client metadata for registrationCOMMENT
LOWsrc/services/oauthClientRegistration.ts289 // Step 3: Perform dynamic client registrationCOMMENT
LOWsrc/services/oauthClientRegistration.ts302 // Step 4: Store registered client informationCOMMENT
LOWsrc/services/sseService.ts183 // Step 1: Try to match as a group (by name or id), since group has higher priorityCOMMENT
LOWsrc/services/sseService.ts242 // Step 2: Not a group, try to match as a server nameCOMMENT
LOWsrc/services/sseService.ts262 // Step 3: Not a valid group or server, deny accessCOMMENT
Hyper-Verbose Identifiers31 hits · 31 pts
SeverityFileLineSnippetContext
LOWfrontend/src/pages/SettingsPage.tsx352function getDefaultTokenLimitForUI(model: string): number {CODE
LOWfrontend/src/pages/SettingsPage.tsx375function parseEmbeddingMaxTokensForUpdate(CODE
LOWfrontend/src/pages/SettingsPage.tsx386function parseBasePacingDelayForUpdate(CODE
LOWscripts/dev-backend.js12function resolvePathFromProjectRoot(value) {CODE
LOWsrc/dao/examples.ts138export async function exampleSystemConfigOperations() {CODE
LOWsrc/dao/examples.ts169export async function exampleUserConfigOperations() {CODE
LOWsrc/utils/path.ts175function resolveSettingsPathFromEnv(envPath: string, filename: string): string {CODE
LOWsrc/utils/ssrf.ts149export function createRedirectValidatingFetch(CODE
LOWsrc/utils/tokenCost.ts41export function serializePromptDefinition(CODE
LOWsrc/utils/tokenCost.ts51export function serializeResourceDefinition(CODE
LOWsrc/utils/tokenTruncation.ts34export function getModelDefaultTokenLimit(model: string): number {CODE
LOWsrc/db/types/postgresVectorType.ts7export function registerPostgresVectorType(dataSource: DataSource): void {CODE
LOWsrc/controllers/oauthServerController.ts34async function resolveBetterAuthUserForAuthorize(CODE
LOWsrc/controllers/oauthServerController.ts106async function validateClientRedirectUri(CODE
LOWsrc/services/changelogService.ts22export function clearChangelogUpdateCache(): void {CODE
LOWsrc/services/changelogService.ts69async function fetchUpdateInfoFromMcphubWeb(CODE
LOWsrc/services/activityLoggingService.ts146export function getActivityLoggingService(): ActivityLoggingService {CODE
LOWsrc/services/hostedInternalAuth.ts58export function serializeInternalRequestBodyForSignature(body?: unknown): string {CODE
LOWsrc/services/hostedInternalAuth.ts143export function verifyInternalExpressRequest(CODE
LOWsrc/services/hostedControlPlaneClient.ts107function createSignedControlPlaneHeaders(CODE
LOWsrc/services/hostedControlPlaneClient.ts119function createValidateHostedApiKeyAuthHeaders(): InternalRequestAuthHeaders {CODE
LOWsrc/services/vectorSearchService.ts853function generateFallbackEmbedding(text: string): number[] {CODE
LOWsrc/services/vectorSearchService.ts1625async function checkDatabaseVectorDimensions(dimensionsNeeded: number): Promise<boolean> {CODE
LOWsrc/services/vectorSearchService.ts1774async function clearMismatchedVectorData(expectedDimensions: number): Promise<void> {CODE
LOWsrc/services/openApiGeneratorService.ts27function convertToolSchemaToOpenAPI(tool: Tool): {CODE
LOWsrc/services/openApiGeneratorService.ts93function generateOperationFromTool(tool: Tool, serverName: string): OpenAPIV3.OperationObject {CODE
LOWsrc/services/hostedEventSubscriber.ts36function shouldSubscribeToRedisEvents(): boolean {CODE
LOWsrc/services/hostedEventSubscriber.ts80export async function startHostedEventSubscriber(): Promise<void> {CODE
LOWsrc/services/hostedEventSubscriber.ts218export async function stopHostedEventSubscriber(): Promise<void> {CODE
LOWsrc/services/templateService.ts218function stripOpenApiSecuritySecrets(CODE
LOWsrc/services/mcpService.ts3671export async function filterResourceTemplatesByGroup(CODE
Hallucination Indicators3 hits · 30 pts
SeverityFileLineSnippetContext
CRITICALsrc/controllers/serverController.ts1993 oidcTarget.providerId = auth.betterAuth.providers.oidc.providerId.trim();CODE
CRITICALsrc/controllers/serverController.ts1997 oidcTarget.discoveryUrl = auth.betterAuth.providers.oidc.discoveryUrl.trim();CODE
CRITICALsrc/controllers/serverController.ts2012 const promptValue = auth.betterAuth.providers.oidc.prompt.trim();CODE
Fake / Example Data15 hits · 22 pts
SeverityFileLineSnippetContext
LOWtests/utils/parameterConversion.test.ts103 const params = { name: 'John Doe' };CODE
LOWtests/utils/parameterConversion.test.ts113 expect(result.name).toBe('John Doe');CODE
LOWtests/controllers/userController.test.ts144 email: 'admin@example.com',CODE
LOWtests/controllers/userController.test.ts150 body: { isAdmin: true, email: 'admin@example.com' },CODE
LOWtests/controllers/userController.test.ts158 email: 'admin@example.com',CODE
LOWtests/services/userService.test.ts114 email: 'admin@example.com',CODE
LOWtests/services/userService.test.ts117 await updateUser('testuser', { isAdmin: true, email: 'admin@example.com' });CODE
LOWtests/services/userService.test.ts120 expect(mockUpdate).toHaveBeenCalledWith('testuser', { email: 'admin@example.com' });CODE
LOWtests/services/betterAuthSession.test.ts129 user: { id: 'ba-456', email: 'user@example.com', name: 'User' },CODE
LOWtests/services/betterAuthSession.test.ts133 username: 'user@example.com',CODE
LOWtests/services/betterAuthSession.test.ts134 email: 'user@example.com',CODE
LOWtests/services/betterAuthSession.test.ts142 expect(mockUpdate).toHaveBeenCalledWith('user@example.com', { ssoUserId: 'ba-456' });CODE
LOWtests/services/betterAuthSession.test.ts147 user: { id: undefined, email: 'user@example.com' },CODE
LOWtests/services/betterAuthSession.test.ts151 username: 'user@example.com',CODE
LOWtests/services/betterAuthSession.test.ts152 email: 'user@example.com',CODE
Over-Commented Block7 hits · 7 pts
SeverityFileLineSnippetContext
LOW.github/workflows/ci.yml61 # - name: Enable CorepackCOMMENT
LOW.github/workflows/ci.yml81 # POSTGRES_PASSWORD: postgresCOMMENT
LOW.github/workflows/ci.yml101 # - name: Install dependenciesCOMMENT
LOWsrc/clients/__tests__/openapi-server-template.test.ts1import { OpenAPIClient } from '../openapi.js';COMMENT
LOWsrc/cli/call-arguments.ts1import fs from 'node:fs';COMMENT
LOWsrc/services/vectorSearchService.ts141 'https://api.openai.com',COMMENT
LOWsrc/services/vectorSearchService.ts201COMMENT