diff --git a/src/NATS.Server/Configuration/NatsConfParser.cs b/src/NATS.Server/Configuration/NatsConfParser.cs
new file mode 100644
index 0000000..77fa52a
--- /dev/null
+++ b/src/NATS.Server/Configuration/NatsConfParser.cs
@@ -0,0 +1,404 @@
+// Port of Go conf/parse.go — recursive-descent parser for NATS config files.
+// Reference: golang/nats-server/conf/parse.go
+
+using System.Globalization;
+using System.Security.Cryptography;
+using System.Text;
+
+namespace NATS.Server.Configuration;
+
+///
+/// Parses NATS configuration data (tokenized by ) into
+/// a Dictionary<string, object?> tree. Supports nested maps, arrays,
+/// variable references (block-scoped + environment), include directives, bcrypt
+/// password literals, and integer suffix multipliers.
+///
+public static class NatsConfParser
+{
+ // Bcrypt hashes start with $2a$ or $2b$. The lexer consumes the leading '$'
+ // and emits a Variable token whose value begins with "2a$" or "2b$".
+ private const string BcryptPrefix2A = "2a$";
+ private const string BcryptPrefix2B = "2b$";
+
+ ///
+ /// Parses a NATS configuration string into a dictionary.
+ ///
+ public static Dictionary Parse(string data)
+ {
+ var tokens = NatsConfLexer.Tokenize(data);
+ var state = new ParserState(tokens, baseDir: string.Empty);
+ state.Run();
+ return state.Mapping;
+ }
+
+ ///
+ /// Parses a NATS configuration file into a dictionary.
+ ///
+ public static Dictionary ParseFile(string filePath)
+ {
+ var data = File.ReadAllText(filePath);
+ var tokens = NatsConfLexer.Tokenize(data);
+ var baseDir = Path.GetDirectoryName(Path.GetFullPath(filePath)) ?? string.Empty;
+ var state = new ParserState(tokens, baseDir);
+ state.Run();
+ return state.Mapping;
+ }
+
+ ///
+ /// Parses a NATS configuration file and returns the parsed config plus a
+ /// SHA-256 digest of the raw file content formatted as "sha256:<hex>".
+ ///
+ public static (Dictionary Config, string Digest) ParseFileWithDigest(string filePath)
+ {
+ var rawBytes = File.ReadAllBytes(filePath);
+ var hashBytes = SHA256.HashData(rawBytes);
+ var digest = "sha256:" + Convert.ToHexStringLower(hashBytes);
+
+ var data = Encoding.UTF8.GetString(rawBytes);
+ var tokens = NatsConfLexer.Tokenize(data);
+ var baseDir = Path.GetDirectoryName(Path.GetFullPath(filePath)) ?? string.Empty;
+ var state = new ParserState(tokens, baseDir);
+ state.Run();
+ return (state.Mapping, digest);
+ }
+
+ ///
+ /// Internal: parse an environment variable value by wrapping it in a synthetic
+ /// key-value assignment and parsing it. Shares the parent's env var cycle tracker.
+ ///
+ private static Dictionary ParseEnvValue(string value, HashSet envVarReferences)
+ {
+ var synthetic = $"pk={value}";
+ var tokens = NatsConfLexer.Tokenize(synthetic);
+ var state = new ParserState(tokens, baseDir: string.Empty, envVarReferences);
+ state.Run();
+ return state.Mapping;
+ }
+
+ ///
+ /// Encapsulates the mutable parsing state: context stack, key stack, token cursor.
+ /// Mirrors the Go parser struct from conf/parse.go.
+ ///
+ private sealed class ParserState
+ {
+ private readonly IReadOnlyList _tokens;
+ private readonly string _baseDir;
+ private readonly HashSet _envVarReferences;
+ private int _pos;
+
+ // The context stack holds either Dictionary (map) or List