Registering the Bareun MCP server in Codex CLI
If you connect the Bareun MCP server to OpenAI Codex CLI, Codex calls Bareun directly while it works to perform Korean morphological analysis and spell checking.
What you need
- A Bareun API key: for issuing keys and usage, see Using the cloud.
- The endpoint address: for Bareun cloud it is
https://api.bareun.ai:443/mcp. If you installed the spell checker yourself, use/mcpon that server's address (for example,http://localhost:5656/mcp). MCP is offered only in Bareun builds that include the spell checker, and installations for morphological analysis only do not have/mcp.
How to register
Codex keeps its MCP settings in ~/.codex/config.toml (or .codex/config.toml of a trusted project).
Add a [mcp_servers.<name>] table for each server, and specify url for a remote HTTP server.
Choose one of the two authentication methods below.
Put the API key in an environment variable and point to it with bearer_token_env_var. This value is sent automatically
as an Authorization: Bearer ... header.
[mcp_servers.bareun]
url = "https://api.bareun.ai:443/mcp"
bearer_token_env_var = "BAREUN_API_KEY"
Set the environment variable before running.
export BAREUN_API_KEY="YOUR_API_KEY"
You can also specify the api-key header directly with http_headers.
[mcp_servers.bareun]
url = "https://api.bareun.ai:443/mcp"
http_headers = { "api-key" = "YOUR_API_KEY" }
If you have an older Codex
If your Codex version does not support remote HTTP MCP (url), you can register the mcp-remote bridge
as a command-based (stdio) server (Node.js required).
[mcp_servers.bareun]
command = "npx"
args = ["-y", "mcp-remote", "https://api.bareun.ai:443/mcp", "--header", "api-key: YOUR_API_KEY"]
Verifying the connection
- Check the registered servers with
codex mcp listin a terminal. - If you ask something like "Correct this sentence with Bareun" in a Codex session, it calls the Bareun tools
(
analyze_syntax,tokenize,list_pos_tags,correct_grammar).
Troubleshooting
- Server not connecting? Check the table name in
config.toml([mcp_servers.bareun]) and the/mcpat the end ofurl. Also check that there are no TOML syntax errors. - Authorization error (401)? Check that the environment variable that
bearer_token_env_varpoints to actually contains the key, or that theapi-keyvalue inhttp_headersis correct. - Is the project
.codex/config.tomlignored? Project settings apply only in trusted projects. Check your trust settings or use the user settings (~/.codex/config.toml).
Frequently asked questions
Q. Should I use bearer_token_env_var or http_headers?
If you do not want to write the key directly in a config file, the environment variable token (bearer_token_env_var) is safer.
Bareun accepts both the Authorization: Bearer <key> and api-key headers, so either works.
Q. My Codex version does not support remote HTTP MCP.
Register mcp-remote as a command-based (stdio) server. Set command = "npx" and put mcp-remote, the
endpoint, and the header in args (Node.js required).