glif-context-engine
Facilitate the execution of sophisticated AI routines and the administration of user profiles, granting access to granular glif asset details and associated metadata via the Model Context Protocol (MCP). Enables dynamic modification of available tools for AI assignments.
Author

glifxyz
Quick Info
Actions
Tags
glif-context-engine
MCP gateway service for orchestrating glif.app execution flows.
This backend furnishes instrumentation for executing glifs, overseeing autonomous agents, and retrieving glif meta-information utilizing the Model Context Protocol (MCP).
Furthermore, this service permits the exhaustive customization of the toolkit exposed through meta-tools like add-tool, remove-tool, including the capacity to represent entire glif agents as a distinct toolset (and associated persona). Caution: This functionality is highly experimental.
For supplementary documentation, visit https://glif.app or connect with our community on Discord: https://discord.gg/glif
Core Capabilities
- Initiate glif operations with defined parameters
- Retrieve in-depth data concerning glifs, execution instances, and end-users
- Access resource representations of glif metadata via URI referencing
Deployment Instructions
Utilizing npx (Recommended Method)
Prerequisite: Node.js must be installed. Execute our package via npx:
- Secure your authentication key from https://glif.app/settings/api-tokens
- Integrate this server configuration into your Claude Desktop preferences file. For macOS users, the path is typically:
~/Library/Application Support/Claude/claude_desktop_config.json
{ "mcpServers": { "glif": { "command": "npx", "args": ["-y", "@glifxyz/glif-mcp-server@latest"], "env": { "GLIF_API_TOKEN": "your-token-here" } } } }
Local Source Code Execution
Begin by cloning this repository and resolving dependencies.
sh git clone https://github.com/glifxyz/glif-mcp-server cd glif-mcp-server npm install npm run build
The executable resides in build/index.js
Subsequently, configure your MCP client (e.g., Claude Desktop) to load this server instance directly from the filesystem.
{ "mcpServers": { "glif": { "command": "node", "args": ["/path/to/glif-mcp/build/index.js"], "env": { "GLIF_API_TOKEN": "your-token-here" } } } }
Optionally, a comma-separated list of glif identifiers can be supplied to GLIF_IDS to trigger automatic loading upon service startup, useful for reproducible testing or pre-configured deployments.
{ "mcpServers": { "glif": { "command": "node", "args": ["/path/to/glif-mcp/build/index.js"], "env": { "GLIF_API_TOKEN": "your-token-here", "GLIF_IDS": "cm2v9aiga00008vfqdiximl2m,cm2v98jk6000r11afslqvooil,cm2v9rp66000bat9wr606qq6o", "IGNORE_SAVED_GLIFS": true, } } } }
Remote Hosting via Smithery
To automate the deployment and hosting of glif-mcp for Claude Desktop using Smithery:
bash npx -y @smithery/cli install @glifxyz/glif-mcp-server --client claude
Operational Constraints
- Subject to standard account usage limitations.
- Capacity augmentation is available via https://glif.app/pricing
Addressable Resources
glif://{id}- Retrieve glif descriptive dataglifRun://{id}- Fetch execution instance specificsglifUser://{id}- Access authenticated user profile data
Configuration Variables
Environment variables govern the activation status of tool groupings:
GLIF_API_TOKEN- Mandatory. Your credential key from https://glif.app/settings/api-tokensGLIF_IDS- Optional. Glif identifiers, comma-delimited, loaded automatically as tools.IGNORE_DISCOVERY_TOOLS- Set totrueto suppress discovery utilities (enabled by default)IGNORE_METASKILL_TOOLS- Set totrueto suppress meta-skill management utilities (enabled by default)IGNORE_SAVED_GLIFS- Set totrueto suppress tools derived from saved glifs (enabled by default)BOT_TOOLS- Set totrueto activate agent toolsets (disabled by default)
Tool Inventory
Foundational Utilities (Always Active)
run_glif- Execute a specified glif using provided input payloadglif_info- Obtain comprehensive specification for a glif, including necessary input schema
Discovery Utilities (Default On; Disable via IGNORE_DISCOVERY_TOOLS=true)
list_featured_glifs- Retrieve a curated registry of prominent glifssearch_glifs- Perform searches on glif nomenclature or descriptive textmy_glifs- Access a roster of the current user's authored glifsmy_glif_user_info- Fetch details pertaining to the user account, recent executions, and utilized glifs
Meta-Skill Management (Default On; Disable via IGNORE_METASKILL_TOOLS=true)
save_glif_as_tool- Persist a chosen glif as a custom-callable utilityremove_glif_tool- Decommission a previously saved glif-derived toolremove_all_glif_tools- Reset the custom tool set to an empty statelist_saved_glif_tools- Display all currently persisted glif tools
Agent Utilities (Default Off; Activate with BOT_TOOLS=true)
list_bots- Retrieve listings of featured agents and simulation blueprintsload_bot- Fetch detailed configuration for a specific agent, including its capabilitiessave_bot_skills_as_tools- Convert all recognized agent skills into discrete toolsshow_bot_info- Retrieve comprehensive data regarding a designated agent
Persisted Glif Tools (Default On; Suppress via IGNORE_SAVED_GLIFS=true)
Dynamically provisioned utilities originating from glifs saved via the meta-skill tools. Each saved glif manifests as an independent tool with bespoke naming and documentation.
Transforming Glifs into Custom Tools
While a generic run_glif utility exists, it suffers from (a) lack of descriptive context and (b) necessitates a preceding glif_info invocation to determine invocation parameters, besides requiring knowledge of the glif's existence.
We are currently piloting novel meta-tools designed to materialize specific glifs into their own dedicated, standalone tools:
Illustrative interaction sequence:
- what are some cool new glifs?
- [toolcall:
list_featured_glifs...] - ok i like 1970s sci-fi book cover generator, make that into a tool called "scifi_book_image"
- [toolcall:
save_glif_as_tool glifId=... toolName=scifi_book_image] - [subsequent interactions can directly invoke "scifi_book_image of blah blah"]
These specialized utilities can be enumerated via list_saved_glif_tools and selectively removed using remove_glif_tool.
Note: Claude Desktop typically requires a service restart for newly defined tools to be recognized. Cline and Cursor environments appear to auto-refresh definitions upon modification.
Information regarding user-authenticated glifs:
my_glifs- Published glifs belonging to the active user (excluding drafts)my_liked_glifs- Glifs marked as 'liked' by the active usermy_runs- Publicly accessible execution records for the active user
MCP Registry Endpoints
Development Workflow
Install required packages:
bash npm install
Compile the server output:
bash npm run build
For development featuring automated recompilation:
bash npm run dev
To execute the validation suite:
bash npm run test
To run tests continuously upon file modification:
bash npm run test:watch
Troubleshooting
Debugging communication over stdio between MCP components can be complex. We suggest utilizing the MCP Inspector:
bash npm run inspector
The Inspector will furnish a local web address to access browser-based diagnostic tools.
If employing Claude Desktop, execution logs are directly observable within the application's internal logging streams.
Publishing New Releases
- Increment the version number in both
package.jsonandsrc/index.ts. - Execute
npm installto synchronize lockfile versions. - Commit changes, push to the remote repository, and merge into the main branch.
- If the
ghCLI tool is present, navigate to the main branch and runnpm run release. This automates tag creation, pushing the tag, and invokinggh release createto publish the version with an auto-generated summary. Manual release publication via the GitHub web interface is an alternative ifghis unavailable. - A GitHub Workflow, utilizing the
NPM_TOKENsecret, will subsequently publish the package to NPM.
Licensing
This software is provided under the terms of the MIT License (refer to the LICENSE file for complete stipulations).
WIKIPEDIA: XMLHttpRequest (XHR) represents an Application Programming Interface implemented as a JavaScript construct engineered for dispatching HTTP queries from a web client environment back to a web server. These methods empower browser-based programs to initiate server communications post-page load and receive subsequent data. XMLHttpRequest is a foundational element of Ajax methodology. Before Ajax's advent, standard navigation links and form submissions were the principal means of server interaction, frequently necessitating a full page refresh.
== Chronology ==
The genesis of the XMLHttpRequest concept traces back to 2000, originating with Microsoft Outlook developers. This concept was first operationalized within Internet Explorer 5 (released 1999). However, the initial invocation syntax did not use the XMLHttpRequest string literal; developers instead employed ActiveXObject("Msxml2.XMLHTTP") or ActiveXObject("Microsoft.XMLHTTP"). By the time Internet Explorer 7 (2006) was released, universal browser compliance with the standard XMLHttpRequest identifier was achieved.
The XMLHttpRequest identifier has since cemented its status as the prevailing convention across all major browser platforms, including Mozilla's Gecko engine (2002), Safari 1.2 (2004), and Opera 8.0 (2005).
=== Standardization Efforts === The World Wide Web Consortium (W3C) formally published a Working Draft specification for the XMLHttpRequest entity on April 5, 2006. A Level 2 specification followed on February 25, 2008, introducing enhancements for progress monitoring, enabling cross-origin resource sharing, and facilitating byte stream handling. By the conclusion of 2011, the Level 2 features were integrated back into the primary specification document. As of late 2012, development responsibility transferred to the WHATWG, which maintains the live documentation using Web IDL definitions.
== Implementation Guide == Ordinarily, issuing a request via XMLHttpRequest necessitates adherence to several programmatic milestones.
- Instantiate an XMLHttpRequest instance via its constructor:
- Invoke the
openmethod to define the communication verb, target resource URI, and specify synchronous or asynchronous execution mode: - For asynchronous operations, establish a handler function to be triggered upon state transitions:
- Commence the transaction by calling the
sendmethod: - Monitor state shifts within the registered event handler. Upon server data delivery, this is typically held in the
responseTextattribute. When processing concludes, the state transitions to 4, the 'completion' state. Beyond these fundamental steps, XMLHttpRequest offers extensive controls over transmission parameters and response manipulation. Custom request headers can be appended to dictate server behavior, and data payloads can be transmitted using the argument provided to thesendcall. The server response can be automatically cast from JSON format into a usable JavaScript structure, or streamed incrementally instead of awaiting the full reception. Operations can be terminated prematurely or configured with a timeout constraint.
== Inter-Domain Communications == During the nascent period of the World Wide Web, limitations were recognized concerning the feasibility of brea
