You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/...?q=api&page=56&format=json
For typeahead suggestions, use the /typeahead
endpoint:
https://codesearch.val.run/typeahead?q=api
Returns an array of strings in format "username" or "username/projectName"
Found 19080 results for "api"(2900ms)
9}
1011interface MCPContextAPI {
12// Tool operations
13listTools: () => Promise<any[]>;
37* - Renders HTML in a secure iframe
38* - Provides fullscreen enter/exit affordances
39* - Exposes MCP context API to iframe content
40* - Handles iframe communication via postMessage
41*/
47console.log("[MCP/Browser Renderer] HTMLRenderer: Rendering HTML:", { mcpClients });
4849// Create MCP context API that will be exposed to iframe
50const createMCPContext = useCallback((): MCPContextAPI => {
51const findClientByName = (serverName: string) => {
52console.log("[MCP/Browser Renderer] Finding client by name:", serverName, mcpClients);
177const { type, id, method, args } = event.data;
178179if (type !== "mcp-api-call") {
180return;
181}
186187if (typeof methodFunc !== "function") {
188throw new Error(`Unknown MCP API method: ${method}`);
189}
190192193iframe.contentWindow?.postMessage({
194type: "mcp-api-response",
195id,
196success: true,
199} catch (error) {
200iframe.contentWindow?.postMessage({
201type: "mcp-api-response",
202id,
203success: false,
222</script>
223<script>
224// MCP Context API for iframe content
225window.mcpContext = {
226// Async wrapper for postMessage communication
227async callAPI(method, ...args) {
228return new Promise((resolve, reject) => {
229const id = Math.random().toString(36).substr(2, 9);
230
231const handleResponse = (event) => {
232if (event.data.type === 'mcp-api-response' && event.data.id === id) {
233window.removeEventListener('message', handleResponse);
234if (event.data.success) {
243
244window.parent.postMessage({
245type: 'mcp-api-call',
246id,
247method,
252setTimeout(() => {
253window.removeEventListener('message', handleResponse);
254reject(new Error('MCP API call timeout'));
255}, 30000);
256});
258
259// Convenience methods
260async listTools() { return this.callAPI('listTools'); },
261async callTool(serverName, toolName, args) { return this.callAPI('callTool', serverName, toolName, args); },
262async listPrompts() { return this.callAPI('listPrompts'); },
263async getPrompt(serverName, promptName, args) { return this.callAPI('getPrompt', serverName, promptName, args); },
264async listResources() { return this.callAPI('listResources'); },
265async readResource(serverName, uri) { return this.callAPI('readResource', serverName, uri); },
266log(level, message, data) { this.callAPI('log', level, message, data); },
267requestFullscreen() { this.callAPI('requestFullscreen'); },
268exitFullscreen() { this.callAPI('exitFullscreen'); },
269async isFullscreen() { return this.callAPI('isFullscreen'); }
270};
271
1import { getArticle, getAuthor } from "./_api.ts";
2import { createServer } from "./_server.ts";
3