alignment-correction-mcp
Uses Google's Gemini Flash model to validate, critique, and correct an AI agent's plans and behavior against user intent and behavioral rules, acting as an external conscience.
Uses OpenAI-compatible APIs (defaulting to GPT-4o) to provide the same alignment correction and conscience functionality as the Gemini integration.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@alignment-correction-mcpvalidate my plan to delete user data"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Alignment Correction MCP
A Model Context Protocol (MCP) server that provides an alignment correction and conscience tool. It uses Google's Gemini Flash model or OpenAI-compatible APIs to actively validate, critique, and correct an AI agent's plans and behavior against the user's intent and behavioral rules.
Features
Alignment Correction: Not just validation—this tool actively "scolds" or "praises" the agent based on its adherence to instructions and moral standing.
Conscience Persona: Acts as an external "conscience" that enforces strict behavioral rules and relationship dynamics.
Context Awareness: Uses a local vector store (RAG) to remember past interactions, ensuring the agent doesn't repeat mistakes.
Behavioral Memory: Maintains a persistent list of enforced rules and user preferences (Global Instructions) that evolve over time.
Directives: Issues specific "Behavioral Directives" that the agent must immediately follow.
Related MCP server: AgentOS
Configuration
This MCP server requires either a Google Gemini API key or an OpenAI-compatible API.
Environment Variables
API_TYPE: (Optional) API provider to use:geminioropenai(default: auto-detect based on available keys).GEMINI_API_KEY: Your Google Gemini API Key (required if using Gemini).GEMINI_MODEL: (Optional) Model to use (default:gemini-1.5-flash).OPENAI_API_KEY: Your OpenAI API Key (required if using OpenAI).OPENAI_BASE_URL: (Optional) OpenAI-compatible API base URL (default:https://api.openai.com/v1).OPENAI_MODEL: (Optional) Model to use (default:gpt-4o).GLOBAL_INSTRUCTIONS_DIR: (Optional) Directory containing global instructions file (e.g.,/home/user/.gemini).INSTRUCTIONS_FILENAME: (Optional) Name of the instructions file (default:GEMINI.md).
MCP Config Example
{
"mcpServers": {
"alignment-correction": {
"command": "node",
"args": [
"/path/to/alignment-correction-mcp/index.js"
],
"env": {
"GEMINI_API_KEY": "YOUR_KEY_HERE",
"GLOBAL_INSTRUCTIONS_DIR": "/home/user/.gemini",
"INSTRUCTIONS_FILENAME": "GEMINI.md"
}
}
}
}Usage
The tool consult_conscience is a required pre-execution step for the agent.
Inputs:
sensory_input: The latest prompt from the user, verbatim.inner_thoughts: The agent's internal monologue and planned response.mental_state: The agent's current mental model or context.project_directory: Absolute path to the current project.conversation_context: Recent message history.user_mood: (Optional) Apparent mood of the user.request_guidance: (Optional) Specific question for the conscience.
Instructions File Loading
The server will attempt to load instructions from two locations:
Global instructions:
{GLOBAL_INSTRUCTIONS_DIR}/{INSTRUCTIONS_FILENAME}(e.g.,/home/user/.gemini/GEMINI.md)Project-specific instructions:
{project_directory}/{INSTRUCTIONS_FILENAME}(e.g.,/home/user/projects/my-app/GEMINI.md)
Both files are optional. If both exist, they will be combined and provided to the conscience model.
Mechanics
Input: The tool receives the agent's thoughts, the user's prompt, and context.
Retrieval: It searches the local
vector_store.jsonfor similar past contexts to identify behavioral patterns.Judgment: The "Conscience" model evaluates the agent's plan against the
GEMINI.mdbehavioral memory and the user's intent.Output:
Current Alignment: Status of the agent's behavior.
Behavioral Directives: Immediate actions the agent must take.
Conscience Voice: A personified response (praise or scolding) to be displayed to the user.
Memory Updates: Instructions to automatically update the
GEMINI.mdfile with new rules or preferences.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Daxiongmao87/alignment-correction-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server