Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/2234839/mcpserver
/ functions
Functions
79 in github.com/2234839/mcpserver
⨍
Functions
79
◇
Types & classes
25
↓ 38 callers
Method
info
(message: string, data?: any)
src/utils/logger.ts:22
↓ 32 callers
Method
error
(message: string, data?: any)
src/utils/logger.ts:26
↓ 29 callers
Function
createErrorResponse
(message: string)
src/utils/common.ts:8
↓ 17 callers
Function
createSuccessResponse
(result: string | object)
src/utils/common.ts:14
↓ 14 callers
Method
warn
(message: string, data?: any)
src/utils/logger.ts:34
↓ 11 callers
Function
getEnv
()
src/utils/helpers.ts:24
↓ 10 callers
Function
createWebSearchError
( code: WebSearchErrorCode, message: string, hint?: string, details?: any )
src/tools/web-search/errors.ts:32
↓ 4 callers
Method
debug
(message: string, data?: any)
src/utils/logger.ts:30
↓ 4 callers
Method
writeLog
(level: string, message: string, data?: any)
src/utils/logger.ts:11
↓ 3 callers
Function
getApiKey
()
src/utils/helpers.ts:59
↓ 3 callers
Function
getBlockKramdown
(blockId: string)
src/tools/siyuan/block-kramdown.ts:32
↓ 3 callers
Method
getTimeToWait
* Get time to wait before next request is allowed * @returns Time in milliseconds to wait, or 0 if request is allowed
src/tools/web-search/rate-limiter.ts:78
↓ 3 callers
Function
searchWeb
(params: SearchWebParams)
src/tools/web-search/client.ts:37
↓ 2 callers
Function
callGLMApi
( messages: any[], options: { temperature?: number; top_p?: number; max_tokens?: number; m
src/utils/helpers.ts:83
↓ 2 callers
Function
createMessage
(content: any[], prompt: string)
src/utils/common.ts:1
↓ 2 callers
Method
delete
* Delete value from cache * @param key Cache key
src/tools/web-search/cache.ts:67
↓ 2 callers
Function
extractIALAttributes
(content: string)
src/tools/siyuan/block-kramdown.ts:86
↓ 2 callers
Function
getModelConfig
(type: 'image' | 'video' | 'generation')
src/utils/helpers.ts:63
↓ 2 callers
Function
handleApiError
(error: any)
src/tools/web-search/errors.ts:161
↓ 2 callers
Function
withRetry
( operation: () => Promise<T>, maxRetries: number = 2, baseDelay: number = 1000 )
src/tools/web-search/errors.ts:53
↓ 2 callers
Function
withTimeout
( operation: () => Promise<T>, timeoutMs: number )
src/tools/web-search/errors.ts:101
↓ 1 callers
Function
calculateCost
* Calculate estimated cost of the search * @param resultCount Number of results * @returns Estimated cost
src/tools/web-search/client.ts:248
↓ 1 callers
Function
calculateSonarCost
* Calculate estimated cost of using a Sonar model * @param model Sonar model type * @param evidenceCount Number of evidence items * @returns Estima
src/tools/web-search/sonar-client.ts:207
↓ 1 callers
Method
checkLimit
* Check if a request is allowed based on rate limit * @returns true if request is allowed, false if rate limit exceeded
src/tools/web-search/rate-limiter.ts:46
↓ 1 callers
Function
createCacheKey
* Create a cache key from search parameters * @param params Search parameters * @returns Cache key string
src/tools/web-search/client.ts:259
↓ 1 callers
Function
deduplicateResults
* Deduplicate search results * @param results Search results * @param strategy Deduplication strategy * @returns Deduplicated results
src/tools/web-search/client.ts:215
↓ 1 callers
Function
encodeImageToBase64
(imagePath: string)
src/utils/helpers.ts:70
↓ 1 callers
Function
executeDatabaseQuery
(params: DatabaseQueryParams)
src/tools/siyuan/database-query.ts:22
↓ 1 callers
Function
executeSQLQuery
(stmt: string)
src/tools/siyuan/sql-query.ts:14
↓ 1 callers
Function
generateAnswerWithSonar
(params: SonarSearchParams)
src/tools/web-search/sonar-client.ts:32
↓ 1 callers
Function
generateImage
( prompt: string, options: { model?: string; quality?: 'hd' | 'standard'; size?: string; u
src/utils/helpers.ts:118
↓ 1 callers
Method
get
* Get value from cache * @param key Cache key * @returns Cached value or null if not found or expired
src/tools/web-search/cache.ts:30
↓ 1 callers
Function
getBlockKramdownMultiple
( blockIds: string[], )
src/tools/siyuan/block-kramdown.ts:41
↓ 1 callers
Method
increment
* Increment request count
src/tools/web-search/rate-limiter.ts:70
↓ 1 callers
Function
isForbiddenIP
* Check if an IP address is in a forbidden range * @param ip IP address string * @returns true if IP is forbidden, false otherwise
src/tools/web-search/security.ts:108
↓ 1 callers
Function
isIPInRange
* Check if an IP address is in a CIDR range * @param ipInt IP address as 32-bit integer * @param range CIDR range string (e.g., "192.168.0.0/16") *
src/tools/web-search/security.ts:141
↓ 1 callers
Function
isValidUrl
(urlString: string)
src/tools/web-search/security.ts:51
↓ 1 callers
Function
isWebSearchError
(error: any)
src/tools/web-search/errors.ts:146
↓ 1 callers
Function
main
()
src/index.ts:38
↓ 1 callers
Function
makePerplexityRequest
* Make a request to the Perplexity API * @param apiKey API key * @param payload Request payload * @returns API response
src/tools/web-search/client.ts:166
↓ 1 callers
Function
makeSiYuanRequest
({ endpoint, data }: SiYuanApiRequest)
src/tools/siyuan/client.ts:8
↓ 1 callers
Function
makeSonarRequest
* Make a request to the Sonar model API * @param apiKey API key * @param payload Request payload * @returns API response
src/tools/web-search/sonar-client.ts:106
↓ 1 callers
Function
normalizeResults
* Normalize search results to a consistent format * @param results Raw results from API * @returns Normalized results
src/tools/web-search/client.ts:198
↓ 1 callers
Function
normalizeSonarResults
* Normalize Sonar model results to a consistent format * @param sonarResult Raw result from Sonar API * @returns Normalized results with Sonar enhan
src/tools/web-search/sonar-client.ts:147
↓ 1 callers
Method
parseTtlFromEnv
* Parse TTL from environment variable string * @param ttlStr TTL string in minutes * @returns TTL in milliseconds
src/tools/web-search/cache.ts:118
↓ 1 callers
Function
performAdvancedWebSearch
(params: AdvancedWebSearchInput)
src/tools/web-search/advanced-web-search.ts:32
↓ 1 callers
Function
performWebSearch
(params: WebSearchInput)
src/tools/web-search/web-search.ts:23
↓ 1 callers
Function
registerAdvancedWebSearchTool
(server: McpServer)
src/tools/web-search/advanced-web-search.ts:76
↓ 1 callers
Function
registerBlockKramdownTool
(server: McpServer)
src/tools/siyuan/block-kramdown.ts:160
↓ 1 callers
Function
registerDatabaseQueryTool
(server: McpServer)
src/tools/siyuan/database-query.ts:48
↓ 1 callers
Function
registerImageAnalysisTool
(server: McpServer)
src/tools/bigmodel/image-analysis.ts:8
↓ 1 callers
Function
registerImageGenerationTool
(server: McpServer)
src/tools/bigmodel/image-generation.ts:10
↓ 1 callers
Function
registerPollinationsAudioGenerationTool
(server: McpServer)
src/tools/pollinations/audio-generation.ts:7
↓ 1 callers
Function
registerPollinationsImageAnalysisTool
(server: McpServer)
src/tools/pollinations/image-analysis.ts:7
↓ 1 callers
Function
registerPollinationsImageGenerationTool
(server: McpServer)
src/tools/pollinations/image-generation.ts:7
↓ 1 callers
Function
registerPollinationsTextGenerationTool
(server: McpServer)
src/tools/pollinations/text-generation.ts:7
↓ 1 callers
Function
registerSQLQueryTool
(server: McpServer)
src/tools/siyuan/sql-query.ts:40
↓ 1 callers
Function
registerSearchTool
(server: McpServer)
src/tools/siyuan/search.ts:90
↓ 1 callers
Function
registerUpdateBlockTool
(server: McpServer)
src/tools/siyuan/block-kramdown.ts:217
↓ 1 callers
Function
registerVideoAnalysisTool
(server: McpServer)
src/tools/bigmodel/video-analysis.ts:7
↓ 1 callers
Function
registerWebSearchTool
(server: McpServer)
src/tools/web-search/web-search.ts:52
↓ 1 callers
Function
sanitizeUrl
(urlString: string)
src/tools/web-search/security.ts:85
↓ 1 callers
Function
searchBlocks
(params: SearchParams)
src/tools/siyuan/search.ts:54
↓ 1 callers
Method
set
* Set value in cache * @param key Cache key * @param data Data to cache * @param ttl Time to live in milliseconds (optional, defaults to defa
src/tools/web-search/cache.ts:52
↓ 1 callers
Method
startCleanupInterval
* Start periodic cleanup of expired entries
src/tools/web-search/cache.ts:94
↓ 1 callers
Function
updateBlock
( blockId: string, data: string, dataType: 'markdown' | 'dom' = 'markdown', options: { preserveIAL
src/tools/siyuan/block-kramdown.ts:99
Method
clear
* Clear all cache entries
src/tools/web-search/cache.ts:75
Method
constructor
()
src/tools/web-search/cache.ts:18
Method
constructor
()
src/tools/web-search/rate-limiter.ts:13
Method
constructor
(projectDir: string = process.cwd())
src/utils/logger.ts:7
Function
formatError
(error: WebSearchError | Error)
src/tools/web-search/errors.ts:133
Function
getSecurityConfig
()
src/tools/web-search/security.ts:215
Method
getStats
* Get cache statistics * @returns Object with cache statistics
src/tools/web-search/cache.ts:84
Method
getStatus
* Get current rate limit status * @returns Object with current status
src/tools/web-search/rate-limiter.ts:103
Function
isContentTypeAllowed
(contentType: string)
src/tools/web-search/security.ts:200
Function
isResponseSizeAcceptable
(size: number)
src/tools/web-search/security.ts:191
Method
reset
* Reset rate limiter
src/tools/web-search/rate-limiter.ts:127
Function
sanitizeHtml
(html: string)
src/tools/web-search/security.ts:170
Method
waitUntilAllowed
* Wait until request is allowed * @returns Promise that resolves when request is allowed
src/tools/web-search/rate-limiter.ts:136